-----------------------------------------------------
Code: Select all
$sql = "SELECT DISTINCT cat, subcat, subcat_id FROM products ORDER BY cat, subcat";
$result = mysql_query($sql);
$last_cat = "";
while ($row = mysql_fetch_array($result))
{
if ($rowї'cat'] !== $last_cat)
{
echo ""{$rowї'cat']}*"\n";
$last_cat = $rowї'cat'];
}
echo ""results.php?tunedsearch={$rowї'subcat_id']}|{$rowї'subcat']}#" +\n";
}I cannot get the ouput to look like this:
-----------------------------------------------------
"Wheels & More*results.php?tunedsearch=aluminumwheels|Aluminum Wheels#" +
"results.php?tunedsearch=plasticwheels|Plastic Wheels#" +
"results.php?tunedsearch=dishwheels|Dish Wheels",
"Nitro Trucks*results.php?tunedsearch=stadiumtrucks|Stadium Trucks#" +
"results.php?tunedsearch=monstertrucks|Monster Trucks#"+
"results.php?tunedsearch=buggies|Buggies",
-----------------------------------------------------
My DB is set up in the following manor:
-----------------------------------------------------
columns: cat, subcat, subcat_id
example row: Wheels & More, Aluminum Wheels, aluminumwheels
-----------------------------------------------------
Any help would be greatly appreciated...thanks in advance,
Ryan