use ORDER BY ASC or DESC $Query = "SELECT * from $TableName ORDER BY DESC";
Mike ----- Original Message ----- From: "Jule Slootbeek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, April 17, 2002 6:38 PM Subject: print on top > Hey guys and gals, > I'm writing this script for my new webpage, and i'm using MySQL to read and > add news articles to a page, but everytime i add a new article it puts it > under the older one, how can i get it on top? > > thanks > > Jule > > $Link = mysql_connect ($Host, $User, $Password); > $Query = "SELECT * from $TableName"; > $Result = mysql_db_query ($DBName, $Query, $Link); > while ($Array = mysql_fetch_array ($Result)) { > print ("<table border=0 align=center valign=top width=100%>"); > print ("<tr align=center valign=top>\n"); > print ("<td align=left valign=top><b><i>$Array[header]</i></b></td>\n"); > print ("</tr>\n"); > print ("<tr align=center valign=top>\n"); > print ("<td align=left valign=top>$Array[article]</td>\n"); > print ("</tr>\n"); > print ("<tr align=center valign=top>\n"); > print ("<td align=right valign=top><font size=-2>Posted by: $Array[name] on > $Array[postdate]</font></td>\n"); > print ("</tr>\n"); > print ("</table>"); > -- > Jule Slootbeek > [EMAIL PROTECTED] > http://blindtheory.cjb.net > > --------------------------------------------------------------------- > 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 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 --------------------------------------------------------------------- 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