Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = mysqli_query($con, "SELECT * FROM users WHERE Username = '".$testname. "' OR Email = '".$testemail. "'");
- $registered = time();
- if(mysqli_num_rows($query) > 0){
- echo "Username or email is already in use.<br>";
- }else{
- $sql = "INSERT INTO users (Username, Password, Email, Firstname, Lastname, Lastlogin, Registered) VALUES ('$testname', '$testpass', '$testemail', '$testfirstname' , '$testlastname', '$lastlogin', '$registered')";
- if ($conn->query($sql) === TRUE) {
- if($sql->errno === 1062) {
- echo "Username or email is already in use.<br>";
- }else{
- echo "New account created successfully<br>";
- }
- }else{
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement