takn25 Posted January 22, 2011 Share Posted January 22, 2011 Hey, First of all I have joined 2 tables in the query below.This is my query Query="SELECT user.*, comment.* "."FROM user, comment "."WHERE user.userid = comment.userid"; which is working as desired, but I want to be more specific, I want to use another WHERE or something in the query Example WHERE page=$_SERVER['REQUEST_URI']; how can I join this with the above query or is there another simpler way thanks. Quote Link to comment https://forums.phpfreaks.com/topic/225269-where-syntax/ Share on other sites More sharing options...
trq Posted January 22, 2011 Share Posted January 22, 2011 Something like.... $page = mysql_real_escape_string($_SERVER['REQUEST_URI']); $Query="SELECT user.*, comment.* FROM user, comment WHERE user.userid = comment.userid && comment.page = '$page'"; Quote Link to comment https://forums.phpfreaks.com/topic/225269-where-syntax/#findComment-1163379 Share on other sites More sharing options...
takn25 Posted January 22, 2011 Author Share Posted January 22, 2011 Thanks Thrope. Syntax was bugging me alot! Quote Link to comment https://forums.phpfreaks.com/topic/225269-where-syntax/#findComment-1163383 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.