PHP 4.0 Bug #8939: Date problem with MySQL
| From: | cormier at iwebgroup dot com | Date: | Fri, 26 Jan 2001 15:40:23 +0000 |
| Subject: | PHP 4.0 Bug #8939: Date problem with MySQL | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45042@lists.php.net to get a copy of this message | ||
From: cormier@iwebgroup.com
Operating system: Linux
PHP version: 4.0.4pl1
PHP Bug Type: MySQL related
Bug description: Date problem with MySQL
./configure --with-mysql=/mysql --enable-bcmath --with-gd
--with-xml --with-imap --with-dbm
--with-apxs=/apache/bin/apxs
The code before update:
$today = date("Y-m-d H:i:00");
$requete = "insert into table (id, date) VALUES (NULL, \"$today\")";
$resultat = mysql_query($requete);
The result:
= 0000-00-00 00:00:00
After some modification:
$requete = "insert into table (id, date) VALUES (NULL, now())";
$resultat = mysql_query($requete);
The result:
= 2001-01-25 19:38:24
Conclusion:
I think there are a incompatibility with de date format
of mysql. I use mysql-3.23.32.
--
Edit Bug report at: http://bugs.php.net/?id=8939&edit=1