| | |
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 array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube





