I keep getting this message

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/j/a/c/jackattacksite/html/register.php on line 80

Here's the code:

// Connect to database
     include_once "scripts/connect_to_mysql.php";
     $emailCHecker = mysql_real_escape_string($email1);
	 $usernameChecker = mysql_real_escape_string($username);
	 $emailCHecker = eregi_replace("`", "", $emailCHecker);
	 $usernameChecker = eregi_replace("`", " ", $usernameChecker);
     // Database duplicate e-mail check setup for use below in the error handling if else conditionals
     $sql_email_check = mysql_query("SELECT email FROM myMembers WHERE email='$emailCHecker'");
     $email_check = mysql_num_rows($sql_email_check); 
	 $sql_username_check = mysql_query("SELECT username FROM myMemebers WHERE username='$usernameChecker'");
	 $username_check = mysql_num_rows($sql_username_check);

I checked if the variables matched, but they seemed to match. Thanks to anyone who helps

i believe this generally means that the search of the database is not returning any result... or something along those lines...

you could try adding a catch after the mysql_query's

something like

$sql_email_check = mysql_query("SELECT email FROM myMembers WHERE email='$emailCHecker'") OR die('Error in mysql syntax: ' . mysql_error());

but gl getting this fixed

I keep getting this message

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/j/a/c/jackattacksite/html/register.php on line 80

Here's the code:

// Connect to database
     include_once "scripts/connect_to_mysql.php";
     $emailCHecker = mysql_real_escape_string($email1);
	 $usernameChecker = mysql_real_escape_string($username);
	 $emailCHecker = eregi_replace("`", "", $emailCHecker);
	 $usernameChecker = eregi_replace("`", " ", $usernameChecker);
     // Database duplicate e-mail check setup for use below in the error handling if else conditionals
     $sql_email_check = mysql_query("SELECT email FROM myMembers WHERE email='$emailCHecker'");
     $email_check = mysql_num_rows($sql_email_check); 
	 $sql_username_check = mysql_query("SELECT username FROM myMemebers WHERE username='$usernameChecker'");
	 $username_check = mysql_num_rows($sql_username_check);

I checked if the variables matched, but they seemed to match. Thanks to anyone who helps

are you sure you want to do this way-

$emailCHecker = eregi_replace("`", "", $emailCHecker);

The proper way to handle the num_rows -

$email_check = 0;
if(mysql_num_rows($sql_email_check) !='' || mysql_num_rows($sql_email_check) !=FALSE)
{
$email_check = mysql_num_rows($sql_email_check); }

Don't use ereg (http://php.net/preg), and read the giant READ ME FAQ at the top of the PHP forums then come back here and ask your question again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.