$r = mysql_query("SELECT * FROM hwureviews ORDER BY category,num DESC");

what are you trying to do with this statement?:
while ($info = mysql_fetch_row($max)) {



-----Original Message-----
From: Alex Behrens [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 4:08 PM
To: [EMAIL PROTECTED]
Subject: help sorting by a column name


Hey Guys,

I need to reorganize the list of reviews on my site so they are displayed by
category. However, I want it to display all the reviews from all categories
at once. How do I do this? Here is my syntax now for display all reviews at
once, but not sorted by category:

<?php
$db = mysql_connect( "db32.pair.com",  "**********",  "********");
mysql_select_db( "net3dual_reviews",$db);
$r = mysql_query("SELECT * FROM hwureviews ORDER BY num DESC");
$max = mysql_query("select max(num) from hwureviews",$db);
while ($info = mysql_fetch_row($max)) {
printf ("<b><font color='#ffffff'>Hardware Reviews - %s Articles
Total</b></font><br>", $info["0"]);
}
while($a=mysql_fetch_array($r)) {
printf ("- <a href=\"%s\">%s</a> (Written by: <a
href=\"mailto:%s\";>%s</a>) - [<a href='%s' onMouseOver='if (window.event ||
document.layers) show(\"%s\",event)'
onMouseOut='hide(\"%s\")'>Description</a>]<br>",$a["url"],$a["name"],$a["ema
il"],$a["author"],$a["url"],$a["name"],$a["name"]);
}
?>

I want it so it displays them like this:

Processors -
Reviews listed here

Motherboards
Reviews listed here

the categories are stored under the column name "category", for reference.

Thanks!
--------------------------------------------
-Alex "Big Al" Behrens
E-mail: [EMAIL PROTECTED]
Urgent E-mail: [EMAIL PROTECTED] (Please be brief!)
Phone: 651-482-8779
Cell: 651-329-4187
Fax: 651-482-1391
ICQ: 3969599
Owner of the 3D-Unlimited Network:
http://www.3d-unlimited.com
Send News:
[EMAIL PROTECTED]


---------------------------------------------------------------------
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

---------------------------------------------------------------------
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