| | |
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 |
apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code cron curl database dataentry date display duplicates dynamic ebooks echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google href htaccess html image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching mediawiki menu mlm multiple mysql number oop paypal pdf php phpincludeissue problem query radio random recursion recursive remote script search server sessions shot sms source sp space speed sql subdomain subscription syntax system table tag tutorial tutorials update upload url validator variable vbulletin video web white youtube





