project3 Posted February 6, 2008 Share Posted February 6, 2008 Im having problems with a select statement. I have a db table (ticket) with sid as on of the fields. when I use WHERE `sid` = $id; I get the error. Column 'sid' in where clause is ambiguous when I use WHERE `ticket.sid` = $id; I get there error. Unknown column 'ticket.sid' in 'where clause' what am i doing wrong? Link to comment https://forums.phpfreaks.com/topic/89675-where-clause-is-ambiguous/ Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 $query="SELECT * FROM ticket WHERE sid='$id'"; Link to comment https://forums.phpfreaks.com/topic/89675-where-clause-is-ambiguous/#findComment-459517 Share on other sites More sharing options...
project3 Posted February 6, 2008 Author Share Posted February 6, 2008 $query="SELECT * FROM ticket WHERE sid='$id'"; that does not make a difference. Link to comment https://forums.phpfreaks.com/topic/89675-where-clause-is-ambiguous/#findComment-459520 Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 does it give the same error? If so then the column just doesn't exist. Link to comment https://forums.phpfreaks.com/topic/89675-where-clause-is-ambiguous/#findComment-459525 Share on other sites More sharing options...
mmarif4u Posted February 6, 2008 Share Posted February 6, 2008 Please post ur whole code. Link to comment https://forums.phpfreaks.com/topic/89675-where-clause-is-ambiguous/#findComment-459527 Share on other sites More sharing options...
project3 Posted February 6, 2008 Author Share Posted February 6, 2008 does it give the same error? If so then the column just doesn't exist. it does, i figured it out though. it needed to be `ticket`.`sid` instead of `ticket.sid` Link to comment https://forums.phpfreaks.com/topic/89675-where-clause-is-ambiguous/#findComment-459528 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.