Posted by kenoli on 11/15/05 15:51
I solved the problem. I was using "date" which is also the name of the
field as the alias. When I used a different name for the alias ("d")
it started ordering corredtly. It was getting the formatting right and
most of the ordering but not completely. When I changed the alias name
it started working correctly. I wonder what it was doing?
The corrected query reads:
$query = "SELECT date_format(date, '%c.%e.%Y') as d, summary
FROM tbl_news_stories ORDER BY date DESC";
$result = mysql_query ($query);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<p>{$row['d']} - {$row['summary']}</p>";
Navigation:
[Reply to this message]
|