GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Jan-2004, 18:02
ssalter ssalter is offline
New Member
 
Join Date: Jan 2004
Posts: 2
ssalter is on a distinguished road

MySQL/PHP inner join


Hi, I am fairly new to php and mysql so this may just be my own ignorance at this point. I am converting an application from ASP/ACCESS to PHP/MySQL. Most of the sql statements seem to work fine but this one popped up tonight and I have no idea what is wrong with it since it worked fine in the original applications.
Anything that is really obviously wrong for a php/mysql app?

Thanks,
Steve

Quote:
SELECT Rec.Diagnosis FROM StudentRec INNER JOIN Rec ON StudentRec.RecNum=Rec.RecNum WHERE StudentRec.StudentID=3412 AND Rec.Condensed=-1 AND Rec.RecNum>82 AND Rec.RecNum<95 GROUP BY Rec.Diagnosis, Rec.RecNum ORDER BY Rec.RecNum
  #2  
Old 02-Jan-2004, 23:13
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello ssalter,

It's hard to say just from reading the query and without some info on the db structure and data (at least for me).

What is the error message if any?
  #3  
Old 03-Jan-2004, 05:29
ssalter ssalter is offline
New Member
 
Join Date: Jan 2004
Posts: 2
ssalter is on a distinguished road
Thanks for the reply!

It worked great on the original application and the data/data structures are the same so I was thinking it might just be an uncompatibility between the way access and mysql handled inner joins. After pounding on it for another couple of hours I gave up, looked at it this morning and immediately found my calling the query was at fault, ie:

Quote:
$$rs= mysql_query($sql,$o_conn) ;
$row = mysql_fetch_array($rs);

I had two blasted $$ in from of the rs recordset when I make the query. Such a simple thing and I spent hours just not seeing it. *shakes head* But then the toughest problems often turn out to be simple typos sometimes.
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
join problem zuzupus MySQL / PHP Forum 0 14-Aug-2003 05:11

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:18.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.