im working on a script and get this error message when i run it.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/t/o/stockscout/html/index.php on line 513
here's the code that makes the eror evn though it posts to the db
CODE
$query = 'SELECT email FROM members WHERE email = '.'\''.$_POST['em'].'\'';
$result = mysql_query($query);
if(mysql_num_rows($result) == 0) {
$insert ="INSERT INTO `members` (fname, lname, address, city, state, zip, phone, em, pass) VALUES ('".$_POST['fname']."', '".$_POST['lname']."', '".$_POST['address']."', '".$_POST['city']."', '".$_POST['state']."', '".$_POST['zip']."', '".$_POST['phone']."', '".$_POST['em']."', '".$pw."')";
$insert2 = mysql_query($insert);
if(!$insert2) {
die(mysql_error());
}
}
any ideas?