Jump to content

Fabio

Members
  • Posts

    3
  • Joined

  • Last visited

Fabio's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi, I tried with fetchAll() and it works. Now, I am going to change the code about password cryptography Thank you
  2. Yes is encript with MD5 function, I controlled the variable $password and it was correct with that in the database
  3. 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; } }
×
×
  • Create New...