I'm using a prepared statement that fails and I don't know why (no error is returned)
Here's my code:
$stmt = $db->prepare("SELECT id, temps, nom, classes FROM profs WHERE matiere = ? AND pass = 0");
if ( false===$stmt ) {
die('prepare() failed: ('.$db->errno.')' . htmlspecialchars($db->error));
}
$rc = $stmt->bind_param("s", $mat);
if ( false===$rc ) {
die('bind_param() failed: ('.$db->errno.')' . htmlspecialchars($stmt->error));
}
$rc = $stmt->execute();
if ( false===$rc ) {
die('execute() failed: ('.$db->errno.')' . htmlspecialchars($stmt->error));
}
This returns only: "prepare() failed: (0)"
Where's the problem?