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 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 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?? 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? 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.