Jump to content

[SOLVED] insert date and time into mysql


robert_gsfame

Recommended Posts

Small things, but really difficult to find the error........

 

i have my column inside table --> date(datetime)

the problem is that once i try to insert the date using:

 

$date = date("YYYY-mm-dd H:i:s");

$query = "INSERT INTO xxxxxx(date)VALUES('$date');

$results = mysql_query('$query');

 

why does the date column still (0000-00-00 00:00:00) , although the other columns have been inserted which means i don't get any problems with the connection

 

 

Link to comment
https://forums.phpfreaks.com/topic/173122-solved-insert-date-and-time-into-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.