Re: PLEASE HELP - PHP menus
- From: "Dani" <zlimfur@xxxxxxxxx>
- Date: Tue, 31 Jul 2007 21:49:39 +0200
<cpptutor2000@xxxxxxxxx> schrieb im Newsbeitrag
news:1185857054.867928.107390@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Could some PHP guru please help me? I am trying to create menus whose
content will be extracted dynamically from a database table. What I am
not sure about is how the information that is extracted from the
database is to be sent to the menu.php file, if I am trying to use a
include ... from inside another php file. Are there any simple
examples anywhere? Any hints or suggestions would be of great help.
Thanks in advance for your help.
hi,
if you are already using some menu.php file, than just get DB data from this
file directly (you don't need to forward it or something).
it could be something like this (for example you have some table menu with
following columns: menu_id, description, menu_order):
$sql = "SELECT menu_id, description FROM menu ORDER BY menu_order";
$result = mysql_query($sql);
while ($row = mysql_fetch_row($result)) {
print "<td>$row[1]</td>";
}
......
it is not complete, but it is quite simple..
greetz,
dani
.
- References:
- PLEASE HELP - PHP menus
- From: cpptutor2000@xxxxxxxxx
- PLEASE HELP - PHP menus
- Prev by Date: Re: mysql command line client
- Next by Date: PHP4->PH5 tutorial
- Previous by thread: Re: PLEASE HELP - PHP menus
- Next by thread: Help with counting total items using hierarchical data structure
- Index(es):
Relevant Pages
|