Re: date format problem...

From: Date: Mon, 14 Aug 2000 20:57:30 +0000
Subject: Re: date format problem...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-11685@lists.php.net to get a copy of this message
Can't you format the date in the select statement: SELECT DATE_FORMAT(date_field, '%a %M %d, %h:%i %p') AS time FROM table ... then $row[time] will have the formatted date already. -- Dominic Kurth Bemis wrote: > > hey all.... > > i'm trying to format a date that i pull out of a mysql database.....heres > the code at line 40 > > 39. $dept = $row["dept"]; > 40. $time = date (%a %M %d, %h:%i %p, $row["time"]); > 41. $body = $row["body"]; > > and heres the error that i get when i call the page.. > > Parse error: parse error, expecting `')'' in /www/juneandstorm/index.php3 > on line 40 > > everything looks ok as far as syntax goes.......so where am i going wrong... > > ~kurth > Kurth Bemis - Senior Linux Network/Systems Administrator, USAExpress.net > > kurth@usaexpress.net > http://www.usaexpress.net/kurth > ICQ - 6624050 > Call Sign - N1TYW > PGP key available - http://www.usaexpress.net/kurth/pgp > > Fight Weak Encryption! Donate your wasted CPU cycles to Distributed.net > (http://www.distributed.net) > > -- > 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

« previous php.general (#11685) next »