sepoto Posted April 19, 2011 Share Posted April 19, 2011 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 More sharing options...
justsomeguy Posted April 19, 2011 Share Posted April 19, 2011 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. Link to comment Share on other sites More sharing options...
sepoto Posted April 19, 2011 Author Share Posted April 19, 2011 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 More sharing options...
birbal Posted April 20, 2011 Share Posted April 20, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.