tuxbuddy Posted April 16, 2008 Share Posted April 16, 2008 I have written a query : $result = mysql_query("SELECT incidents.id,incidents.description,users.firstname,users.surname,users.loginname from incidents,users where (incidents.owner_id = users.id) AND (incidents.contact_id = users.id) AND (' . ' select users.id from users where users.loginname='$myusername')"), $link); I have doubt on the line: (' . ' select . Anyone who can help me with this?? Link to comment https://forums.phpfreaks.com/topic/101315-how-to-write-nested-query/ Share on other sites More sharing options...
zenag Posted April 16, 2008 Share Posted April 16, 2008 i think it might be on this line where (incidents.ownerid = users.id) it must be specified as tablename.users.id not like this... Link to comment https://forums.phpfreaks.com/topic/101315-how-to-write-nested-query/#findComment-518226 Share on other sites More sharing options...
sasa Posted April 16, 2008 Share Posted April 16, 2008 try $result = mysql_query("SELECT incidents.id,incidents.description,users.firstname,users.surname,users.loginname FROM incidents,users WHERE (incidents.owner_id = users.id) AND (incidents.contact_id = users.id) AND (users.loginname='$myusername')"), $link); Link to comment https://forums.phpfreaks.com/topic/101315-how-to-write-nested-query/#findComment-518437 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.