All right. Here's the code I'm using:
if ($title1){
$paramArray[] = "WHERE title1 LIKE '%$title1%'";
}
... etc ...
This is how I build the sql command:
$sql = mysql_query("SELECT * FROM works " . implode(" AND ", $paramArray) ."");
I ran the search and also had it output what the string was and I got this as the string:
SELECT * FROM works WHERE title1 LIKE '%Nothing%' AND WHERE title2 LIKE '%Ness%' AND WHERE category='Audio'
and I also got the following error:
Warning: Supplied argument is not a valid MySQL result resource in /home/sites/site19/web/php_test/works.php on line 344
... any ideas why I get the error? Also, the search works fine when I only enter data for one field, but when there is more than one field with info, then it returns nothing. Something wrong with the sql syntax I'd imagine, but everything looks ok to me.
Thanks,
Kyle