note 23463 deleted from function.date by philip

From: Date: Sat, 26 Oct 2002 22:37:55 +0000
Subject: note 23463 deleted from function.date by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-38609@lists.php.net to get a copy of this message
Ok, I am adding this because for some strange reason, PHP would not allow me to use the DATE_FORMAT function in the mysql query to format the date. It was null. I am very new to this, and this is the only way I could figure out how to convert a simple 'date' type from MYSQL to a more US user friendly date. It's probably just our config though. $query="SELECT something, date FROM table where name='$name'"; $date=mysql_query($query, $connection); while ($usedate=mysql_fetch_array($date, MYSQL_ASSOC)) { extract ($usedate, EXTR_PREFIX_ALL, "d"); $year=substr($d_date,0,4); $month=substr($d_date,5,2); $day=substr($d_date,8,2); echo "$name, $month-$day-$year"; }

« previous php.notes (#38609) next »