Advertisement
Crecket

Untitled

Feb 19th, 2015
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. $query = mysqli_query($con, "SELECT * FROM users WHERE Username = '".$testname. "' OR Email = '".$testemail. "'");
  2. $registered = time();
  3. if(mysqli_num_rows($query) > 0){
  4.     echo "Username or email is already in use.<br>";
  5. }else{
  6.     $sql = "INSERT INTO users (Username, Password, Email, Firstname, Lastname, Lastlogin, Registered) VALUES ('$testname', '$testpass', '$testemail', '$testfirstname' , '$testlastname', '$lastlogin', '$registered')";
  7.     if ($conn->query($sql) === TRUE) {
  8.         if($sql->errno === 1062) {
  9.             echo "Username or email is already in use.<br>";
  10.         }else{
  11.             echo "New account created successfully<br>";
  12.         }
  13.                
  14.     }else{
  15.                    
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement