php vs css small problem

I did the next:
[php]

  • contact us
    • support
    • sales
[/php] I used css for build a drop menu with this simple structure. My question is this: I want to get this UL LI fields from database. It's easy just select them and echo The problem is how to echo to this structure the sub categiries. I mean to echo "main", "register", "login", "contact" its ok just 'while ****' do '****' But how give this function to give me the ul and li under the original and only if exist. Hope you understand and can help. THANKS!

Do you mean like this?

[php]

<?php $sql = "SELECT * FROM table"; $result = mysql_query($sql); while($row=mysql_fetch_array($result)){ if($row['main'] == !null){ echo ("
  • ".$row['main'].""); }; if($row['register'] == !null){ echo ("
    • ".$row['register']."
    • "); } [/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service