![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Oct 2006
Posts: 15
Rep Power: 0
![]() |
Entering DATETIME values with PHP
Hi
I'm pretty new to PHP/MySQL and I am having trouble entering dates into a database. I've got the database set up and one of the fields is a DATETIME field. What I want to do is put the time that the record was entered into that file. This is what I'm currently doing, but it leaves the date as the default value in the database (0000-00-00 00:00:00): [PHP]$phpTime = time(); $mySqlTime = gmdate("YYYY-mm-dd H:m:s", $phpTime); $dateAdded = strtotime($mySqlTime . " GMT");[/PHP] Is that completely wrong or am I just missing something trivial and/or blindingly obvious? Thanks, Banjo |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Php with Sun Java System Application Server Platform | lucifer | PHP | 0 | Jun 7th, 2007 4:03 AM |
| Classes in PHP | kruptof | PHP | 9 | May 11th, 2007 9:44 PM |
| C# Datetime data types | King | C# | 2 | Jun 4th, 2006 11:21 PM |
| Returning two values | Navid | C | 19 | Jun 13th, 2005 2:57 AM |
| Problem Inserting Values into mySQL from PHP | stakeknife | PHP | 1 | Mar 23rd, 2005 8:45 AM |