[PHP-DEV] PHP 4.0 Bug #8939 Updated: Date problem with MySQL From: rasmus <email protected>
Date: 01/26/01

ID: 8939
Updated by: rasmus
Reported By: cormier <email protected>
Old-Status: Open
Status: Closed
Bug Type: MySQL related
Assigned To:
Comments:

Why did you put quotes around $today and not around now() ? And if quotes are needed at all, surely they should be single quotes.

Previous Comments:
---------------------------------------------------------------------------

[2001-01-26 10:40:23] cormier <email protected>
./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.

---------------------------------------------------------------------------

Full Bug description available at: http://bugs.php.net/?id=8939

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>