Advertisement
Guest User

Untitled

a guest
Oct 25th, 2017
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. $query = "SELECT * FROM `user` WHERE username='$username' and password='$password'";
  2. $stmt = $connection->prepare('SELECT  * FROM user where username=? and password=?');
  3. $stmt->bind_param('ss', $username,$password);
  4. $stmt->execute();
  5. $result = $stmt->get_result();
  6. //var_dump($stmt);
  7. $count = $result->num_rows;
  8. //$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
  9. //$count = mysqli_num_rows($result);
  10. //3.1.2 If the posted values are equal to the database values, then session will be created for the user.
  11. $stmt->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement