sungpeng Posted April 29, 2009 Share Posted April 29, 2009 $sql = "SELECT * FROM users WHERE specialise1 LIKE '%$specialise1%' or specialise2 LIKE '%$specialise1%' or specialise3 LIKE '%$specialise3%' ORDER BY listdate LIMIT $offset, $rowsperpage"; First I would like to check whether the sequence for WHERE, ORDER, LIMIT is correct. Second I see the 'or' seen not working. pls help Quote Link to comment https://forums.phpfreaks.com/topic/156057-solved-or-and-sequence-mysql-query/ Share on other sites More sharing options...
rashmi_k28 Posted April 29, 2009 Share Posted April 29, 2009 specialise1,specialise2,specialise3 should be a field name Quote Link to comment https://forums.phpfreaks.com/topic/156057-solved-or-and-sequence-mysql-query/#findComment-821570 Share on other sites More sharing options...
sungpeng Posted April 29, 2009 Author Share Posted April 29, 2009 yes it is a field name. The "OR" is not working. Is there another "OR" symbol for php. || I try cannot work?? Quote Link to comment https://forums.phpfreaks.com/topic/156057-solved-or-and-sequence-mysql-query/#findComment-821572 Share on other sites More sharing options...
Mchl Posted April 29, 2009 Share Posted April 29, 2009 The query looks fine. Do you get any errors running it? Quote Link to comment https://forums.phpfreaks.com/topic/156057-solved-or-and-sequence-mysql-query/#findComment-821630 Share on other sites More sharing options...
fenway Posted April 29, 2009 Share Posted April 29, 2009 Also, you should normalize your table. Quote Link to comment https://forums.phpfreaks.com/topic/156057-solved-or-and-sequence-mysql-query/#findComment-821805 Share on other sites More sharing options...
sungpeng Posted April 30, 2009 Author Share Posted April 30, 2009 must use "OR" instead of "or". Thank Quote Link to comment https://forums.phpfreaks.com/topic/156057-solved-or-and-sequence-mysql-query/#findComment-822404 Share on other sites More sharing options...
Mchl Posted April 30, 2009 Share Posted April 30, 2009 Nope. MySQL keywords are not case sensitive. Quote Link to comment https://forums.phpfreaks.com/topic/156057-solved-or-and-sequence-mysql-query/#findComment-822461 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.