Just getting started with PDO
I tried debugging my queries, but I receive no logfile
try{
$stmt = $db->prepare(
"INSERT INTO psc_history
(version_stamp, psc_id,version_author , pscname) VALUES
(:version_stamp, :tableprimkeyvalue, :version_author, :fieldvalue)
ON DUPLICATE KEY UPDATE pscname = :fieldvalue2, version_author = :version_author2;");
$stmt->execute(array(':version_stamp' => "2015-09-23 01:14:59"
, ':tableprimkeyvalue' => 5478
, ':version_author' => 9999
, ':fieldvalue' => "hello1"
, ':fieldvalue2' => "hello2"
, ":version_author2" => 9999));
} catch (PDOException $ex) {
echo($ex->getMessage());
}
Nothing gets written to the table
version_stamp and psc_id are primary keys
I get no error neither.
What am I missing?
EDIT
when changing the psc_id to a new value that does not exist: the record gets inserted
when changing the datetime to a value that does not exist: the record does not get inserted
maybe a problem with my DB setup?