Jump to content

date into database


matthew798

Recommended Posts

hey guys.

 

I am trying to get the date to be stored in an MYSQL databse. But it executes a mathematical equation each time and return the answer instead of the date LOL!

 

I explain...

 

$date = date("m-d-y");

mysql_query("INSERT INTO news 
(title, body, date) VALUES('Timmy Mellowman', '23', $date  ) ") 
or die(mysql_error()); 

 

I always get 0.125000000000000000 as the date!

 

I tried with "-" but then it gives me -8 lol.... I know, this is stupid but i just can't figure it out and i dont wanna have to separate it with a letter or sumthing...

Link to comment
https://forums.phpfreaks.com/topic/123380-date-into-database/
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.