I have the following code (php, mysql, pdo):
$stmt = $db->prepare("INSERT INTO agent_temp SET party=?, date = NOW()"); $stmt->execute(array($party));
at startup, the side is correctly inserted, but the date is not inserted (as it should be) (system date and time during operation). I checked many times when the type of field for a date is the date and time.
Any ideas?
EDIT
To provide evidence and results:
suppose the following:
$ party = 'John';
the result returns:
party | date ------------------------------------- John | 0000-00-00 00:00:00
update:
When I run the following code directly in the mysql query browser, the insert works as it should:
Paste into agent_temp set party = 'John', date = NOW ();
return:
party | date ------------------------------------- John | 2010-12-28 13:15:23
ANSWERED
Well, who is ready to kill me? I have no idea what it caught up with, but unfortunately the problem seems to be related to an earlier version of php script from my machine, which is cached and still working with bad data. I updated, closed and emptied my browser, and now the script is working. We apologize for the fact that all the brains have melted a little.
source share