Yes yes sorry this is exactly how its set up.
SELECT * FROM tbl_admin WHERE user='$user' AND pass=PASSWORD('$pass');
Datebase example:
user_id | user | pass
datahere | datahere | datahere
password inserted with PASSWORD()
user_id is just an Auto_Increment
user and pass are VARCHAR(15)
But the point i am getting at is that my query doesnt return results when using a valid username and password in $user and $pass. This should work and i just dont know what i am doing wrong?
My code
if (isset($_POST['submit'])) {
$strUser = $_POST['user'];
$strPass = $_POST['pass'];
if($strUser && $strPass) {
if (mysql_connect("localhost", "username", "password")) {
if (mysql_select_db("database")) {
$sql = "SELECT * FROM tbl_admin WHERE user = '$strUser' AND pass = PASSWORD('$strPass')";
$result = mysql_query($sql);
if (mysql_num_rows($result)==1) {
echo("Welcome!");
}else{
echo("NO SOUP FOR YOU!");
}
}
}
}