OZONE Asylum
Forums
Server-Side Scripting - Oh my!
MySQL Help please
This page's ID:
32661
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
well... after a little more searching, I answered my own question. but for the sake of anyone who might be searching and come across this, here's what I came up with. since I use identical column names in different tables, I had to set up aliases using AS. here's what I came up with [code] $SQL = mysql_query(" SELECT s.uid AS s_uid, s.fname AS s_fname, s.lname AS s_lname, s.ptdob AS s_ptdob, r.lname AS r_lname, h.lname AS h_lname, s.dos AS s_dos FROM studies s LEFT JOIN refmds r ON r.uid = s.ordering LEFT JOIN hhcmds h ON h.uid = s.reading WHERE s.lname LIKE '$lname%' AND s.fname LIKE '$fname%' "); echo "<table><tr><th>First Name</th><th>Last Name</th><th>Date of Birth</th><th>Ordering</th><th>Reading</th><th>Date of Service</th><th>Actions</th></tr>\n"; while($row = mysql_fetch_array($SQL)) { ?> <tr> <td><? echo $row['s_fname'] ?></td> <td><? echo $row['s_lname'] ?></td> <td><? echo $row['s_ptdob'] ?></td> <td><? echo $row['r_lname'] ?></td> <td><? echo $row['h_lname'] ?></td> <td><? echo $row['s_dos'] ?></td> <td> <a href="edit.php?uid=<? echo $row['s_uid'] ?>"><img src="img/edit.png"></a> <a href="delete.php?uid=<? echo $row['s_uid'] ?>"><img src="img/delete.png"></a> </td> </tr> <? } mysql_close($connection); echo "</table>\n"; ?> [/code] [sigrotate] Of all the things I've lost, I miss my mind the most (Ozzy Osbourne)| Some people say I'm a dreamer, but I'm not the only one (John Lennon)| Life is too short, so love the one you got (Bradley Nowell)| I focus on the pain; The only thing that's real (Trent Reznor)| I know the pieces fit, 'cause I watched them fall away (Maynard J. Keenan)| Take your time, hurry up; the choice is yours just don't be late (Kurt Cobain)| You could stand me up at the gates of hell, but I won't back down (Tom Petty)| Do you serve a purpose or purposely serve (Corey Taylor)| You know I'd like to keep my cheeks dry today, so stay with me and I'll have it made (Shannon Hoon) [/sigrotate]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail