---SOLVED---Search Multiple SQL Fields
Posted: Sat Oct 04, 2008 11:31 pm
I have a simple search scrpt that is working searching one field in a SQL database that I want to use in another script to search multiple fields for the search term. This is the code used to specify the search field:
where "name" is what would be the syntax to add say a field called "name2" as well. I even tried a wild card but I received this error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/results_bol.php on line 44
Any suggestions greatly appreciated.
Code: Select all
// Build SQL Query
$query = "select * from BOL where name like \"%$trimmed%\"
order by name"; // EDIT HERE and specify your table and field names for the SQL query
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/results_bol.php on line 44
Any suggestions greatly appreciated.