I want to show menus on my pages but i want that the menus atem are picked up from database. I used static menus with dhtml menu but i dont know how to make them dynamic based on mysql database. Some one help me how can i do that.
Thats easy, get those values from your database. For example, im going to make my menu with UL <ul> <?php $sql = mysql_query("your query here to retrieve the item"); while ($row = mysql_fetch_array($sql)) { echo "<li>$value</li>"; } </ul> PHP:
I want javascript drop down menus . when mouse move on "Products" menu open LIke "pro1 pro2 and so one" but i want these menus based on mysql database values. The li and ul are not menus
You're right they're not.. but just replace the li and ul with the correct tags . <?php $query = mysql_fetch_assoc($sql); echo "<select name='blahblah'>"; while (($row = mysql_fetch_assoc($query))) { echo "<option value='$row[id]'>$row[name]</option>" } echo "</select>"; ?> PHP: Minus the foogly syntax I did
The ul or li tags or <option> tags this is all about html. I want to use javascript menus. e.g As shown on the top of this site. when u click on Fen stuff on the top bar a menu apper. I want to association of php and mysql and javascript to produce this type of dropdown menus.
I dont think anyone will give you a better example than that .It is not html as you think , it involves php and MYSQL codes to fetch elements . Please work on it .