RE: [PHP-DB] Converting Date for mysql
| From: | Bastien Koert | Date: | Thu, 14 Oct 2004 20:15:33 +0000 |
| Subject: | RE: [PHP-DB] Converting Date for mysql | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-36807@lists.php.net to get a copy of this message | ||
did you look to see what the data format was? many of these calendars fill in american dates (mm-dd-yyyy) and mysql prefers (yyyy-mm-dd)....check to see what the format is before you assign it to the session id...
bastien
From: Stuart Felenstein <stuart4m@yahoo.com> To: php-db@lists.php.net Subject: [PHP-DB] Converting Date for mysql Date: Thu, 14 Oct 2004 12:14:57 -0700 (PDT) I have one of those widget calendars. Mysql keeps throwing back the date regardless of the way I format it. I'm passing session variables over to the database and have tried quotes ' around the date as well. Now I went ahead and changed this line: $_SESSION['f3k'] = $_POST['DateAvailable']; to $_SESSION['f3k'] = date('Y-m-d', mktime(0,0,0,substr(3,5,$_POST['newdate']), substr(0,2,$_POST['newdate']), substr(6,10,$_POST['newdate']))); I now tried to pass 'newdate' into the database and still rejected. Any ideas ? Stuart -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php