Hi everyone,

I'm using a very simple PHP script with mySQL to load a news feed (url
encoded) into flash. I've got it working but I would like the records to
come out in the opposite order, with the newest one first.

This is the script:

<?php
 $db = mysql_connect("localhost", "root", "pass");
 mysql_select_db("sanchoDiary",$db);
 $sql="SELECT * FROM news";
 $result=mysql_query($sql,$db);
 $num = mysql_num_rows($result);
 $cur = 1;

 echo "num=$num&newsFeed=";

 while ($num >= $cur) {

 $row = mysql_fetch_array($result);

 $newsposter = $row["newsposter"];
 $newsitem = $row["newsitem"];
 $link = $row["link"];
 $datetime = $row["datetime"];

 echo "<font color=\"#FF0000\"><b>$newsposter</b></font><font
color=\"#663366\"><br>-----------------------------------------<br>$newsitem
<br></font><font color=\"#FF00FF\"><u><b><a href=\"$link\"
target=\"_blank\">$link</a></b></u></font><br>------------------------------
-----------<br><font size=\"-1\"
color=\"#666666\">$datetime</font><br><br>";

 $cur++;
 }
 echo "&newsLoaded=1&dummy=1";
?>

Can anyone help me to sort this out?

cheers

Phil Clandillon
--------------------------------------------------
Graphic and Interactive Design
--------------------------------------------------
work: http://www.clandillon.com
play: http://www.mrming.co.uk


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to