you just cross-posted this to the mysql mailing list.

is this a mysql issue or PHP issue?

-----Original Message-----
From: Alex Behrens [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 4:33 PM
Subject: [PHP-DB] sorting by colum name with nested loops

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:

$db = mysql_connect( "",  "**********",  "********");
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)'

I want it so it displays them like this:

Processors -
Reviews listed here

Reviews listed here

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

-Alex "Big Al" Behrens
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:
Send News:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to