RE: [PHP] Date problem (brain burn !)

From: Date: Mon, 30 Oct 2000 02:50:17 +0000
Subject: RE: [PHP] Date problem (brain burn !)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22598@lists.php.net to get a copy of this message
On 30-Oct-00 richard wrote: > 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','city','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 ? trying to insert the string 'NOW()'; try it without the quotes: values('test2','passqw','1.com','fname','lname','add1','add2','city','st','z ip','cvountry',NOW(),'yes','html','website').. Regards, -- Don Read dread@texas.net There are old sailors, and there are foolish sailors; but damn few old foolish sailors. ---------------------------------------------

« previous php.general (#22598) next »