<?php
include "config.php";
?>
<?php
$username = $_POST['username'];
$password = $_POST['password'];
?>
<?php
$sql = "SELECT username FROM usr";
$resultuser = $conn->query($sql);
$conn->close();
$sql = "SELECT password FROM usr";
$resultpass = $conn->query($sql);
$conn->close();
?>
<?php
if ($resultuser == $username) {
if($resultpass == $password) {
echo "test";
} else {
echo "Wrong user or pass" ;
}
}
?>
Php won't send a query to mysql to check if the variable (username, and password) matches one of the rows in my mysql database. I'm not sure what else to do also config.php is the file which contains the code to connect to my mysql server.