I am trying to search two tables with the same structure in a PHP search form. I am stuck on trying to get it to search both tables. I am relatively new to PHP/MySQL and i have bee thru the MySQL website and came up with this:
$result = mysql_query("
SELECT bans1.nick1, bans2.nick2
FROM pb_bans_04 as bans1
LEFT JOIN pb_bans05 as bans2 ON bans1.nick1 = bans2.nick2
WHERE nick LIKE '%$search1%'
");
$rows = mysql_num_rows($result);
Ever time I run the search, I get errors
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
What am I doing wrong?