merylvingien Posted November 20, 2009 Share Posted November 20, 2009 else { $sql=("SELECT email, ipaddress FROM table"); $result = mysql_query($sql); $row = mysql_fetch_array($result); if($row['email'] == $email) {echo 'error message'; include("foot.html"); exit;} if($row['ipaddress'] == $ipAddress) {echo 'error meassage'; include("foot.html"); exit;} } For some reason this code is being bypassed and even if the email address and ipaddress is already in the database it still goes forth and registers a user for a second time. Am i missing something? Link to comment https://forums.phpfreaks.com/topic/182280-solved-how-comes-this-code-is-being-ignored/ Share on other sites More sharing options...
rajivgonsalves Posted November 20, 2009 Share Posted November 20, 2009 there is no where clause in your select query Link to comment https://forums.phpfreaks.com/topic/182280-solved-how-comes-this-code-is-being-ignored/#findComment-961847 Share on other sites More sharing options...
merylvingien Posted November 20, 2009 Author Share Posted November 20, 2009 I wasnt aware that i needed a where clause, can i not just select all the emails from the database and all the ipaddress's and check them? Link to comment https://forums.phpfreaks.com/topic/182280-solved-how-comes-this-code-is-being-ignored/#findComment-961852 Share on other sites More sharing options...
rajivgonsalves Posted November 20, 2009 Share Posted November 20, 2009 I think your better off only checking email addresses sorry made a mistake $sql= "SELECT email FROM table where email = '{$email}' "; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) {echo 'error message'; include("foot.html"); exit;} Link to comment https://forums.phpfreaks.com/topic/182280-solved-how-comes-this-code-is-being-ignored/#findComment-961853 Share on other sites More sharing options...
merylvingien Posted November 20, 2009 Author Share Posted November 20, 2009 Ok i fixed that now, many thanks. I have to check ip's becuase the same people are signing up with different email addresses. Cheaters LOL Link to comment https://forums.phpfreaks.com/topic/182280-solved-how-comes-this-code-is-being-ignored/#findComment-961863 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.