Re: Adding an DATETIME as a string to a mySQL databse....
| From: | Daniel Convissor | Date: | Thu, 13 Jul 2000 13:03:01 +0000 |
| Subject: | Re: Adding an DATETIME as a string to a mySQL databse.... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6433@lists.php.net to get a copy of this message | ||
Hi Mattias:
> > In article <B5920F6A.4BA5%mattias@popwire.com>, mattias@popwire.com
> > (Mattias Hedman) wrote:
> >
> > > When I build the string using DATE("Y-m-d H:i:s") in PHP and inserts it
> into
> > > the database the only thing that gets added in the row is DATETIME
> default
> > > value (0000-00-00 00:00:00).
Does your insert statement have the date in quotes? If you use the
2000-07-07 10:30:20 format, the number is considered a string, so needs
quotes around it. If you use 20000707103020, it's considered a number and
you don't need to use the quotes.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
More than just answers. Solutions. (SM)
http://www.analysisandsolutions.com/
4015 7 Av #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409