SELECT * FROM

From: Date: Wed, 29 Aug 2001 14:55:03 +0000
Subject: SELECT * FROM
Groups: php.general 
Request: Send a blank email to php-general+get-65030@lists.php.net to get a copy of this message
Hello all, I have a designing a website of which people can submit news to, this works fine. Just on the main page I have the following code (snippet); <?php $db = mysql_connect("localhost", "root"); mysql_select_db("tolkiengossip",$db); $result = mysql_query("SELECT * FROM news",$db); if ($myrow = mysql_fetch_array($result)) { echo "<table width=100% border=1 color=black cellpadding=3 cellspacing=0 bordercolor=#666666>\n"; do { printf("<tr bgcolor=#CCCC99><b>Title:</b> %s <b>By:</b> %s | <b>Date:</b> %s </tr><tr><b> Article:</b> %s</tr><tr><b> URL:</b> <a href=%s target=_blank>Click here</a></tr><br>\n", $myrow["title"], $myrow["nickname"],$myrow["created"],$myrow["article"],$myrow["link"]); } while ($myrow = mysql_fetch_array($result)); echo "</font></table>\n"; This again works fine just, the problem is that it always leaves the first ever article submitted at the top of the page and the latest go down and down etc... I would like to get the latest article to go at the top and oldest to the bottom. Any help would be gratefully apreciated! Kind Regards Tarrant Costelloe (Taz) Development Department ------------------- (+44) 01273 852014 (+44) 07714087114 ------------------ Qoute/Saying/Poem of the day: "Common sense is the collection of prejudices acquired by age eighteen." - George Burns DISCLAIMER: Any opinions expressed in this email are those of the individual and not necessarily those of insurE-Com Ltd. (http://www.insur-e.net). This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from insurE-com, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the technical Infrastructure Group by telephone on +44 (0)1273 204203 or via mail to tgeorge@insur-e.net, including a copy of this message. Please then delete this email and destroy any copies of it.

« previous php.general (#65030) next »