Re: newbie needs to format time field
| From: | Paul Burney | Date: | Thu, 06 Sep 2001 04:50:50 +0000 |
| Subject: | Re: newbie needs to format time field | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12206@lists.php.net to get a copy of this message | ||
on 9/5/01 9:22 PM, Eric J Schwinder at eric@bergencomputing.com wrote:
> thanks so much, I've gotten a lot from that page of the mySQL
> documentation...
Here's another one for you:
<http://www.mysql.com/doc/S/E/SELECT.html>
<quote> A SELECT expression may be given an alias using AS. </quote>
So instead of:
> SELECT DATE_FORMAT(date,'%m/%d/%y') FROM ...
You could do this:
SELECT DATE_FORMAT(date,'%m/%d/%y') AS mydate FROM ...
> I tried using that query, but then I didn't know how to get the formatted
> date out of the array field in my PRINTF lines (what goes in the [" "]?)
Using the above code, the value you're looking for is mydate, i.e.,
echo $myrow['mydate'];
HTH.
Sincerely,
Paul Burney
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Paul Burney
Webmaster && Open Source Developer
UCLA -> GSE&IS -> ETU
(310) 825-8365
<webmaster@gseis.ucla.edu>
<http://www.gseis.ucla.edu/>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++