I'm doing a PDO insert using the following code. The $con connection is working fine. This insert, however, fails with no useful error message.
Table Structure
`user_id` int(11) NOT NULL,
`email_address` varchar(100) NOT NULL,
`salt` varchar(6) NOT NULL,
`password` varchar(300) NOT NULL,
`verified` varchar(1) NOT NULL DEFAULT 'N',
`date_registered` datetime NOT NULL,
`last_login` datetime DEFAULT NULL
(user_id is an auto-increment/primary key)
Insert code
$stmt = $con->prepare("INSERT INTO 'users' ('email_address','salt','password','verified','date_registered') VALUES (:email, :salt, :pwdHash, 'N', SYSDATE())");
$stmt->bindParam(':email',$email, PDO::PARAM_STR);
$stmt->bindParam(':salt',$salt, PDO::PARAM_STR);
$stmt->bindParam(':pwdHash',$pwdHash, PDO::PARAM_STR);
$result = $stmt->execute();
if(!$result) {
echo "ERROR CREATING USER ACCOUNT: ";
print_r($con->errorInfo());
} else {
echo "success";
}
This returns the following error:
ERROR CREATING USER ACCOUNT: Array ( [0] => 00000 [1] => [2] => )
Which contains no useful information. Any advice on troubleshooting this? The db account has insert privileges. I've done this a dozen times on other projects without issues (using the same basic code).