(c) 2007, DHTML-Menu.com
  Recent Questions
  Write To Support

    Do you have a working sample of the drop down menu html code with PHP/MySQL?

Return to Recent Questions

Q: I want to create the drop down menu html code on my website using PHP/MySQL. I have found some info on it in your Support section, but have problems to understand and wonder if you have additional info or a working sample of the drop down menu html code with PHP / MySQL.

A: Info about generating drop down menu html code (menu items )from a database, please, see:

The content of .php file depends on your database structure.
See the example of .php file:


// The example for PHP/MySQL.
// MySQL database has the table "menuTable" that contains data for drop down menu html code items.
// The table has the following fields:
// 1. "text" - item text
// 2. "link" - item link
// 3. "icon1" - item icon (normal state)
// 4. "icon2" - item icon (mouseover state)
function getMenuItems()
$jsItems = '';

// Select all records from table "menuTable"
$allItems = mysql_query('SELECT * FROM menuTable;');

// Extract items data from database and build Javascript code for menuItems
while ($itemData=mysql_fetch_array($allItems))
$jsItems .= '["'.$itemData['text'].'", "'.$itemData['link'].'", "'.$itemData['icon1'].'", "'.$itemData['icon2'].'"],';

// Return Javascript code
return $jsItems;


var menuParam1 = value1;
var menuParam2 = value2;
var menuParam2 = value2;

var menuItems = [


// Write Javascript code for menu items
echo getMenuItems();




Return to Recent Questions

Copyright (c) 2012, DHTML-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Write Us
All rights reserved. video background | website design software | best website builder software | mp4 to webm | css3 menu