John Cornett wrote:
I think I know what you are trying to get done... Perhaps the code below will help:
$result = @("SELECT DISTINCT category_name from <table name>");
While($row = @mysql_fetch_array($result) {
echo "$row[category_name]\n"; // Category A, B, etc...
$result2 = @("SELECT product from <table name> where category_name = '$row[category_name]'");
While($row2 = @mysql_fetch_array($result2)) {
echo "$row2[product]\n";
} //End Product Loop
} // End Category Loop
If you need any help with this one, just let me know more specifics and I'll do what I can. 🙂
John Cornett
Senior Development Engineer
Web Teks, Inc.
http://www.web-teks.com