for example, i want this...
Code: Select all
+--------------+
| Categories |
+--------------+
| 1. Plates |
| 2. Spoons |
| 3. Forks |
| 4. Knives |
| 5. Pressure Cookers |
| 6. Bed Sheets|
| 7. Pots and Pans |
| 8. Wine |
| 9. Salt and Pepper |
+--------------+Code: Select all
+--------------+
| Categories |
+--------------+
| 1. Plates |
| 2. Spoons |
| 3. Forks |
| 4. Knives |
| 5. Pressure |
| Cookers |
| 6. Bed Sheets|
| 7. Pots and |
| Pans |
| 8. Wine |
| 9. Salt and |
| Pepper |
+--------------+Code: Select all
<UL>
<?php
$sql = mysql_query("SELECT * FROM categories WHERE parent=0");
while($row = mysql_fetch_array($sql)){
echo "<LI><a href=\"index.php?cat=". $row[id] ."\">". $row[name] ."</a></LI>\n";
}
?>
</UL>thanks for all your help.