I have a table with a field:
‘last_modified – timestamp NOT NULL’
- I set the default value to the current timestamp. However this only works when updating or inserting from phpMyAdmin and not from my script.
I have tried
$sql = sprintf("UPDATE %s SET timestamp=now(), %s WHERE id='%s'", $table, $implodeArray, $_POST['id']);
and it still doesnt seem to work. How can I make the timestamp update when I update or insert by table from a script?
Also heres a sample of the scripts output:
UPDATE about SET timestamp=now(), page_header = ‘Page header goes here’, sub_header = ‘Sub header goes here’, content_short = ‘This is where a short description of the about page goes’, content = ‘This is where the full content description goes’ WHERE id=’1′
May be I misread,but your column name is last_modified (typed timestamp), so the query should be: