Re: showing text string of month from mysql query
| From: | CPT John W. Holmes | Date: | Fri, 18 Apr 2003 11:37:48 +0000 |
| Subject: | Re: showing text string of month from mysql query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144396@lists.php.net to get a copy of this message | ||
> i have a mysql table with timestamp field in it.. what i want to do is
show
> the date on a web page from that date.. so far i have for my query:
>
> $query=mysql_query("select dayofmonth(Posted) as day, month(Posted) as
> month, year(Posted) as year, ...");
Use DATE_FORMAT() in your query. It works similar to the date() function in
PHP. It's in the MySQL manual, chapter 6, Date and Time functions.
---John Holmes...