OK well I just found out that now the guy I'm doing this for only wants 2 fields searched, instead of the entire database. That makes my job much easier. So I have the code and I'm testing it out and now I'm getting this error:
Warning: Supplied argument is not a valid MySQL result resource in /home/sites/site27/web/sql/ryan/sql.php on line 25
Here is the search bit of the code:
<?php
if($_POST['submit'] == "Search") {
$search = mysql_query("SELECT * FROM accounts,courses,family,members WHERE accounts,courses,family,members LIKE '%$famname%' OR accounts,courses,family,members LIKE '%$famid%'");
$num = mysql_num_rows($search);
if($num > 0) {
while($row = mysql_fetch_array($search)) {
echo("Family ID:" . $row['fam_id']);
}
}
}?>
Line 25 refers to the $num = mysql_num_rows($search); line. I thought I was doing this right. Apparently not. Any suggestions? Thanks. 🙂