RE: [PHP] Date problem (brain burn !)
| From: | Samantha Savvakis | Date: | Mon, 30 Oct 2000 02:48:50 +0000 |
| Subject: | RE: [PHP] Date problem (brain burn !) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-22597@lists.php.net to get a copy of this message | ||
Hi,
Why don't you create the date field in the DB table as a "TIMESTAMP". That
way, every time you insert into the table, it takes the time that the insert
happened.
In the SQL command for the insert statement, you specify "NULL" where the
date field is.
Sam
> -----Original Message-----
> From: richard [mailto:rmccluskey@incubanks.com]
> Sent: Monday, 30 October 2000 12:09
> To: PHP List
> Subject: [PHP] Date problem (brain burn !)
>
>
> Hi folks, fellow listers
>
> I'm having a breakdown... In using PHP4 to create an insert
> statement into a
> mySQL database. the database has a field "date"
> I want the sql statement to put in the current date, so I did this...
>
> Insert into database (nameID, passwd, email, firstname, lastname,
> address1,
> address2, city, state, zip, country, memberdate, brigmail, emailtype,
> website)
>
> values('test2','passqw','1.com','fname','lname','add1','add2','cit
> y','st','z
>
> ip','cvountry','NOW()','yes','html','website')...
> however, the value for the date in the mySQL table comes out as
> "0000-00-00"
>
> what am I doing wrong ?
>
>
> richard
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>