Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function numRowsGreatherThanOne($sql, $parameters) {
- $conn = getConnection(); //Function I made that returns a connection
- $stmt = $conn->prepare($sql);
- call_user_func_array([$stmt, "bind_param"], $parameters);
- $stmt->execute();
- $stmt->store_result();
- if ($stmt->num_rows > 1) {
- return true;
- }
- else {
- return false;
- }
- }
- $username = "User123";
- $password = "Secret";
- numRowsGreatherThanOne("SELECT * FROM users WHERE username=? AND password=?", ["ss", $username, $password]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement