Need help inserting current timestamp into mysql

Associate
Joined
2 Aug 2005
Posts
680
I've got a table with a field TIMESTAMP, but I've tried everything I can think of and still can't get the current timestamp in there. I'm using php to insert the data, should I be using php to generate the time and date then insert the numbers, or should I use timestamp with default to CURRENT_TIMESTAMP in mysql?

Thanks
 
Sorry mate, no joy. The date field is a timestamp at the moment, should I be using datetime? When I'm printing it back I'm just getting 0000-00-00 00:00:00 s
 
Thanks for your help, I managed to sort it in the end by inserting $date in this:
Code:
$date = date('Y-m-d H:i:s');
into a datetime field.
 
Back
Top Bottom