Fabio
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Fabio
-
-
Yes is encript with MD5 function,
I controlled the variable $password and it was correct with that in the database
-
Hi to everyone,
I am preparing the log-In page and when I am going to controll if the user is present in the user-list with two fields: matricola and password, MySQL return zero record.
I do not understand where is the error because I am novice in programming with PHP.
The code is:
function controlUser($matricola, $password)
{
include $_SERVER['DOCUMENT_ROOT'] . '../db.conn.php';
try
{
$sql = 'SELECT COUNT(*) FROM personale WHERE Matricola = :matricola AND password = :password';
$s = $pdo -> prepare($sql);
$s -> bindValue(':matricola', $matricola);
$s -> bindValue(':password', $password);
$s -> execute();
}
catch (PDOException $e)
{
$error = 'Errore durante la ricerca!';
include $_SERVER['DOCUMENT_ROOT'] . '../error.html.php';
exit();
}
$row = $s -> fetch();
if ($row[0] > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}
The query return 0 record
in PHP
Posted
Hi,
I tried with fetchAll() and it works.
Now, I am going to change the code about password cryptography
Thank you