PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Here is the error message:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/nitro/public_html/signup.php on line 95
I have had that annoying pointless error for the longest amount of time. It is related to the rest of the code and not only those 2 lines... you need to show us more code especially if you have an if statement somewhere there because that's where my problem arose.
You've got 2 FROM clauses in that SQL statement. It looks like you'll probably have some other problems with it too so try this, which should give you a better, MySQL generated, error:
$query = mysql_query("SELECT username FROM verify, username FROM account WHERE username='$username'");
$num = mysql_num_rows($query);
if ($num > 0)
{
echo "<center><b>Error!</b> The username "$username" is already in use. Please try a differant one.";
form();
exit();
}
<?php
$result = mysql_query("SELECT a.* FROM `verify` as a, `account` as b WHERE a.username = '$username' AND b.username = '$username'") or die ("b0rked: ".mysql_error());
if (mysql_num_rows($result) >= 1) {
?>