Re: list table by date
| From: | Seung-woo Nam | Date: | Sun, 15 Apr 2001 22:17:50 +0000 |
| Subject: | Re: list table by date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48662@lists.php.net to get a copy of this message | ||
You can sort in descending order in your sql statement
select * from messagem where flag-1 order by date desc
Seung-woo Nam
Augusto Cesar Castoldi wrote:
>
> I have a little mysql question. I'm using php to list a table from mysql.
>
> I'm doing: $result=mysql_query("select * from messagem where flag=1 order
> by
> date");
>
> But The first list of the "mysql_fetch_row($result)" is the first date. I
> want to start printing by the last date.
>
> But I want to know if I can do this by the mysql_query. I don't want this:
>
> $i = mysql_numrows($result);
> while ($i >= 0) {
> print mysql_result($result, $i, 'date')."<br>";
> }
>
> regards,
>
> Augusto Cesar Castoldi
>