Mysqli prepared insert statements always returning false
- by user1754679
I'm writing prepared statements that are supposed to insert data into a table, on a database that's been pre-selected in the variable $GLOBALS['mysqli']. The connection has been tested, and that's not the problem I'm having. I'm only running into trouble whenever my prepared statement involves INSERT INTO. I know the tablename, and field names are correct, but $stmt is ALWAYS false. What gives?
$stmt = $GLOBALS['mysqli']->prepare("INSERT INTO audit_RefreshCount (user, count, lastrefresh) values (?,?,?)");
if ($stmt == TRUE) {
$stmt->bindParam('ssi', $_SESSION['username'], '0', time());
//$stmt->bind_Param('ssi', $_SESSION['username'], '0', time()); // Also doesn't work.
$stmt->execute();
}