Advertisement
Crecket

Untitled

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