forumnz Posted December 26, 2007 Share Posted December 26, 2007 I want my script to search more than one field in a table, but whenever I add more than 1 i get error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/www/vhosts/somewhere.com/httpdocs/clickme/search2.php on line 36 Code snippet: $query = "select * from clickme where 'keywords', 'buzzname' like \"%$trimmed%\" order by keywords"; Thanks, Sam. Quote Link to comment https://forums.phpfreaks.com/topic/83200-solved-search-help/ Share on other sites More sharing options...
trq Posted December 26, 2007 Share Posted December 26, 2007 Because your syntax is foobar'd. $query = "SELECT * FROM clickme WHERE keywords LIKE '%$trimmed%' OR buzzname LIKE '%$trimmed%' ORDER BY keywords"; Quote Link to comment https://forums.phpfreaks.com/topic/83200-solved-search-help/#findComment-423218 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.