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
thanks for the reply, TP. the statement you gave me pulls the right records, but I can't seem to get the data to show up right. Here's what I have: [code] $SQL = mysql_query(" SELECT studies.*, hhcmds.* FROM studies, hhcmds WHERE hhcmds.uid = studies.reading AND studies.lname LIKE '$lname%' AND studies.fname LIKE '$fname%' ORDER BY studies.lname "); 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['studies.fname'] ?></td> <td><? echo $row['studies.lname'] ?></td> <td><? echo $row['ptdob'] ?></td> <td><? echo $row['ordering'] ?></td> <td><? echo $row['hhcmds.lname'] ?></td> <td><? echo $row['dos'] ?></td> <td> <a href="edit.php?uid=<? echo $row['uid'] ?>"><img src="img/edit.png"></a> <a href="delete.php?uid=<? echo $row['uid'] ?>"><img src="img/delete.png"></a> </td> </tr> <? } [/code] but my results aren't what I was expecting. I'm not getting any data returned for studies.fname, studies.lname or hhcmds.lname and uid is returning the uid from the hhcmds table, but for the appropriate doctor associated with the number saved in the reading field. do you suppose I should change the names of the columns in one table or the other? it just doesn't make sense to me that I'd have to use a different name for each table's unique id field. [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