mike12255 Posted October 7, 2011 Share Posted October 7, 2011 I got two statments: "SELECT id FROM approvednotes WHERE authoer = '$username'"; "SELECT nid FROM usersdownloaded WHERE username - '$author'"; and then once I get results from both of those I want to search approved notes again using only the matches from the statements above and what I want to select this time is "SELECT * FROM approvednotes WHERE md5 ='$md5'"; But I dont actually want to search all the listings just the ones that returned true in the first two statements, is there a way to join these three statements into one? I hope I made myself clear if not let me know and ill try to reexplain. Quote Link to comment https://forums.phpfreaks.com/topic/248596-help-with-joining-mysql-statments/ Share on other sites More sharing options...
spec36 Posted October 7, 2011 Share Posted October 7, 2011 Look up LEFT JOIN in the mysql manual that corresponds to your mysql version. I think that will explain what you are trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/248596-help-with-joining-mysql-statments/#findComment-1276673 Share on other sites More sharing options...
mike12255 Posted October 7, 2011 Author Share Posted October 7, 2011 Thanks for pointing me in the right direction, will go look it up now. Quote Link to comment https://forums.phpfreaks.com/topic/248596-help-with-joining-mysql-statments/#findComment-1276771 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.