I got a users table in my db where the passwords are encrypted with the PASSWORD function.The thing is i want to create a login system i cant figure out how.I know i can use something like this
SELECT `username`,`password`
FROM `users`
WHERE `username` = $user
AND `password` = PASSWORD($password)
but i want to use prepared statements so my code looks like this
$sql = "SELECT * FROM users WHERE username=? AND
password=?";
//.....
$stmt = $mysqli->prepare($sql);
$stmt->bind_param("ss", $u,$p);
Any ideas?