My problem is that I’m getting a 4200 error code from my pdo insert. On my computer when I was working with XAMPP it worked fine (no error) but as soon as I ported it onto the server I got this error. Could someone enlighten me or point me in the direction to get the answer. Thanks.
$add_nonce = $db->con->prepare("INSERT INTO nonces(nonce, issue_date, `used`) VALUES(:nonce, :issue_date, '0')");
$add_nonce->bindParam(':nonce', $nonce, PDO::PARAM_STR);
$issue_date = time();
$add_nonce->bindParam(':issue_date', $issue_date, PDO::PARAM_INT);
$add_nonce->execute();
Log_String("test", $add_nonce->errorCode());
$nonce_id = $db->con->lastInsertId();
return $nonce;
Instead of logging just error code, you have to tell PDO to throw exception, which contains also full error message.
Instead of home-brewed Log_String() function you have to tell PHP to log all errors by default, using
log_errorsanderror_logini directives.Or, if on development server, just turn
display_errorson.And you will immediately know what’s going wrong.