Skip to content

Instantly share code, notes, and snippets.

@KOUISAmine
Created February 10, 2017 19:47
Show Gist options
  • Save KOUISAmine/1ac0f65e4f2c8ec4b381e65bbbc0b8c2 to your computer and use it in GitHub Desktop.
Save KOUISAmine/1ac0f65e4f2c8ec4b381e65bbbc0b8c2 to your computer and use it in GitHub Desktop.
<?php
require_once 'connect.php';
$username = $_POST['username'];
$password = $_POST['password'];
$stmt = $conn->prepare("SELECT * FROM `user` WHERE username = '$username' && `password` = '$password'") or die(mysqli_error());
if($stmt->execute()){
$result = $stmt->get_result();
$num_rows = $result->num_rows;
}
if($num_rows > 0){
echo "Success";
}else{
echo "Error";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment