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? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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;} Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.