PDA

View Full Version : Joint Selects


ThermoDust
11-23-2002, 09:51 AM
Select * From support, s_tickets WHERE sid.sid = '$sid.$sid' AND uid.uid = '$uid.$uid'

Why do I get an error saying

"Unknown table 'sid' in where clause"

Even tho I know there is a table sid in there...

madMoney
11-23-2002, 01:41 PM
because you didn't specify that you want to get data from that sid table.. you're gonna get the same error with the uid table also.

in fact, this doesn't make much sense, because nothing there will limit the number of results from the two tables that you are selecting from.

are you sure sid and uid aren't just fields within one of those other tables?

iDxMan
11-23-2002, 05:51 PM
Yes, as madMonkey stated, you're reading data from tables `support and s_tickets` but using a different table in your where statement... Not going to work. Post the schema and we can probably give you better tips.


Also, the alert image is only for mod/admin use : http://www.coderforums.net/cfinfo.php

ThermoDust
11-23-2002, 05:56 PM
Opps, my bad sorry :'( Well, I fixed the problem on my own. But thanks for the replies. :)