Jump to content

$row = $result->fetch_row();


sepoto

Recommended Posts

  if($failed == false){	$sql = "select count(*) from dsg_users where email like '$email'";	$result = $db->query($sql);	$row = $result->fetch_row();	if($row[0] > 0){		$msg .= "That email has already been registered"; 		$failed = true;	}  }

It is noteworthy I think that at this point the table 'dsg_users' is empty. For some reason I am not sure of yet "$row = $result->fetch_row();" halts execution of the script. I believe that this script was written for PHP5.2. I always seem to get great guidance from this forum. Thank you.

Link to comment
Share on other sites

You can probably use $result->num_rows to check the number of rows before trying to get a row. Other than that, the error message from PHP would help.
There is no error message. Perhaps that is because my php.ini is set to be too permissive. Thank you very much for your reply.
Link to comment
Share on other sites

did you tried the sugestion to check the number of rows using $result->num_rows()?you have to check the number of rows. if its zero then no email id is there else it has.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...