| | |
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 |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date development directory display download dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parse parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql structure syntax system table thesishelp tutorial update upload url validation validator variable video web xml youtube





