| | |
PHP Date always returns 0
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Sep 2008
Posts: 6
Reputation:
Solved Threads: 0
I am trying to insert a date into a mysql table field using
but when I open up mysql and run SELECT * FROM table; it returns a date value of 0000-00-00 instead of the current date at time of insert. Am I misunderstanding something with the php date function?
PHP Syntax (Toggle Plain Text)
<?php $date=date(Y-m-d); mysql_query("INSERT INTO table VALUES('$date')"); ?>
but when I open up mysql and run SELECT * FROM table; it returns a date value of 0000-00-00 instead of the current date at time of insert. Am I misunderstanding something with the php date function?
![]() |
Similar Threads
- csv, convert date, mysql, php (PHP)
- php mysql question (PHP)
- Php (PHP)
- New to php and need some help with a guestbook (PHP)
- vBulletin mod_rewrite (PHP)
- This ought to be simple - extra spaces (PHP)
- Logic to Convert Days From 1800 to a Date (Month, Day, Year) (C++)
- Advanced mySQL Querys (PHP)
Other Threads in the PHP Forum
- Previous Thread: Word Press MU
- Next Thread: Php page containing html form to sql database
| Thread Tools | Search this Thread |
.htaccess alexa apache api array beginner beneath binary broadband broken cakephp checkbox class cms code convert cron curl database date display dynamic echo email emptydisplayvalue encode error fcc file files folder form forms function functions google howtowriteathesis href htaccess html image images include insert ip javascript joomla key keywords limit link login mail mail() memberships menu mlm multiple multipletables mysql mysql_real_escape_string network oop open passwords paypal pdf php provider query radio random redirect remote rss script search securephp server sessions smtp source space sql strip_tags syntax system table template tutorial update upload url user validator variable video voteup web youtube





