Jump to content

PHP vs sqlite3 login error


Chikwado

Recommended Posts

Good day admin

Please a newbie is struggling here and needed a help.

<?php
$db = new SQLite3('test.db');
$userlog = "Chikwado";
$userpass = "wizard&33";
$sql = "SELECT * FROM user
WHERE username = '$userlog'
AND password = '$userpass'
LIMIT = 1";
$result = $db->query($sql);
while ($row = $result->fetchArray(SQLITE3_ASSOC)){
if($row['username'] === $userlog && $row['password'] === $userpass) {
echo "Login was successfully.";
}else{
echo "Invalid credentials.";
}
}
unset($db);
?>

To run the code above, I get http code failure. 

I need help and advice.

Your advice is greatly appreciated.

Edited by Chikwado
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...