Will something like:
Insert the current date of the insert into the database?PHP Code:$date = date(whatever);
$sql = mysql_query("INSERT INTO blah VALUES '$date'");
| SitePoint Sponsor |




Will something like:
Insert the current date of the insert into the database?PHP Code:$date = date(whatever);
$sql = mysql_query("INSERT INTO blah VALUES '$date'");
If knowledge is power - Why isn't our army librarians?!
Statistics show that 63% of all statistics are fake.
When i was little i broke my neck, and i havent looked back since.
I completed the internet in 1 week. The end boss was pretty easy though.


Probably this will help you!
Code:CREATE TABLE blah ( id int(11) NOT NULL auto_increment, date datetime NOT NULL default '2004-01-01 00:00:00', UNIQUE KEY id (id) ) TYPE=MyISAM;PHP Code:mysql_query("INSERT INTO blah VALUES ('', NOW( ) );");
Rype :: book, do, charge, collect,
track time, track expenses and invoice easily on the go.
Available on Mac, Win, iPhone, WinMobile.
http://www.rypenow.com




I dont really wanna re-create the database as i have loads of work to be done..i jsut want to know the correct format to inset a date into a database.
If knowledge is power - Why isn't our army librarians?!
Statistics show that 63% of all statistics are fake.
When i was little i broke my neck, and i havent looked back since.
I completed the internet in 1 week. The end boss was pretty easy though.
Use timestamp format. Int 15.
- Nathan




Cheers![]()
If knowledge is power - Why isn't our army librarians?!
Statistics show that 63% of all statistics are fake.
When i was little i broke my neck, and i havent looked back since.
I completed the internet in 1 week. The end boss was pretty easy though.
Originally Posted by 1337-Dev
Sure it will, but dependant upon the column type in MySQL.
Bookmarks