dhope Posted December 24, 2009 Share Posted December 24, 2009 Hi, Is it possible to use two where's in one statement. My code is: mysql_query("SELECT page_name FROM pages WHERE user_id = $user_ids WHERE page_visible = 1 ORDER BY page_position ASC") Thanks in advance for any help. Quote Link to comment https://forums.phpfreaks.com/topic/186249-is-it-possible-to-use-two-wheres-in-one-statement/ Share on other sites More sharing options...
ignace Posted December 24, 2009 Share Posted December 24, 2009 No you can not use two WHERE keywords in your query statement. You need boolean operators like AND, XOR and OR thus: SELECT page_name FROM pages WHERE user_id = $user_ids AND page_visible = 1 ORDER BY page_position ASC But you would have already know that if you had read the mysql manual -> http://dev.mysql.com/doc/ Quote Link to comment https://forums.phpfreaks.com/topic/186249-is-it-possible-to-use-two-wheres-in-one-statement/#findComment-983601 Share on other sites More sharing options...
dhope Posted December 24, 2009 Author Share Posted December 24, 2009 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/186249-is-it-possible-to-use-two-wheres-in-one-statement/#findComment-983615 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.