Jump to content

[SOLVED] mysql_num_rows help


steviez

Recommended Posts

Hi,

 

I keep getting this error in my script:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/****/public_html/register.php on line 62

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/****/public_html/register.php on line 92

 

Here is the code in question:

 

<?php
// Check That Email Is Not In Use
  $check = "SELECT email FROM members WHERE email = '".$_POST['email']."'"; 
  $qry = mysql_query($check); 
  if(mysql_num_rows($qry) !== 0) 
  { 
  $error = 1;
  $error_message = "The email address you have entered is already in use, please use a different email address or login to your existing account.";
  }

// Check That Username Is Not In Use
  $check = "SELECT username FROM members WHERE username = '".$_POST['username']."'"; 
  $qry1 = mysql_query($check); 
  if(mysql_num_rows($qry1) !== 0) 
  { 
  $error = 1;
  $error_message = "The username you have chosen is in use by another member, please choose a new username.";
  }
?>

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/111532-solved-mysql_num_rows-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.