Milonic Menu form DB MySQL/PHP
Milonic Menu form DB MySQL/PHP
I have searched this forum for a script to build up the Menu from a DB. I have found some .asp related scripts but no .php, does someone knows where I can find this, or not then I will develop this one.
- bonewalker
- Super Advanced
- Posts: 40
- Joined: Tue Aug 19, 2003 10:35 pm
I have done a very large menu (over 1700 items) using PHP. It isn't difficult really.
All you need to do is create a MySQL query that returns your data, then output it via php in the correct format for the menu to use. Then instead of menu_data.js, point your script to menu_data.php.
All goes smoothly for me.
Here is a code snippet: (be aware I am not a programmer, so I don't know anything about classes)
Hope that helps.
Bonewalker
All you need to do is create a MySQL query that returns your data, then output it via php in the correct format for the menu to use. Then instead of menu_data.js, point your script to menu_data.php.
All goes smoothly for me.
Here is a code snippet: (be aware I am not a programmer, so I don't know anything about classes)
Code: Select all
$sql="select * from $table where name like '$letter%' order by name";
$menu_data.="with(milonic=new menuname(\"s$letter\")){\r\n itemwidth=300;\r\n borderwidth=1;\r\n style=style1;\r\n alignment='left';\r\n top=150;\r\n overflow='scroll';\n";
$result = db_query($sql);
while ($record = get_record($result))
{
$name=$record[name];
$ext=$record[ext];
$roomapt=$record[roomapt];
$city=$record[city];
$state=$record[state];
$zip=$record[zip];
$homephone=$record[homephone];
$email=$record[email];
$menu_data.= "aI('text=<font size=2><b>$name - $ext</b></font><br>$roomapt<br>Home - $homeaddy, $city $state $zip<br>$homephone<br>$email;separatorsize=1;align=left')\n";
}
$menu_data.="\n } \n";
echo $menu_data;
Bonewalker