Created
December 11, 2016 07:23
-
-
Save annibuliful/c691d9597fc5f8ade22d93e1f60ca304 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$servername = "localhost"; | |
$username = "root"; | |
$password = "12345678"; | |
$dbname = "test1"; | |
$user = $_GET['Us']; | |
$pass = $_GET['Ps']; | |
$email = $_GET['Em']; | |
$conn = new mysqli($servername, $username, $password,$dbname); | |
$sql = "SELECT * FROM register WHERE Username = '".$user."' OR Email = ".$email.";"; | |
$exec = $conn->query($sql); | |
$fetch = $exec->fetch_assoc(); | |
if($fetch != TRUE){ | |
$sql = "INSERT INTO register(Username, Password,Email) | |
VALUES ('".$user."', '".$pass."', '".$email."')"; | |
if ($conn->query($sql) === TRUE) { | |
echo"สมัครเรียบร้อย"; | |
} | |
}else{ | |
echo"มีชื่อนี้แล้ว";} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment