When you query a database, will you get this error message if the database is empty? This works fine if it finds a match, but when I dump the table, I get this error message again:
Warning: mysql_fetch_array():
supplied argument is not a valid MySQL result resource in
/web/apache/htdocs/x/x/input.php on line 30
Where lines 28-32 are:
28 $sql = "SELECT * FROM speaker WHERE id='".$_POST['id']."' LIMIT 1";
29 $result = mysql_query($sql,$dblink) || die("QUERY FAILED: $sql");
30 while ($row = mysql_fetch_array($result)) {
31 $num++;
32 }
What I'm wanting to do is to check for a match and if one is not there, then I want to create a record. Since all I'm doing is checking for a match, then maybe I need to use a different mysql argument. Would that fix the problem?