0

という名前の次のmysqlテーブルがあるとしましょうpages

--------------------------------------------------------------------
 id | menu_id | menu_text   | page_title  |  page_text             
--------------------------------------------------------------------
 1  | 1       | Home        | Homepage    |  Here is the page text 
 2  | 2       | About Us    | About Us    |  "      "      "     " 
 3  | 3       | History     | Our History |  "      "      "     " 
--------------------------------------------------------------------

これをメニューとして表示するにはどうすればよいですか?

<ul>
 <li><a href="http://localhost/index.php?id=1">Home</a></li> 
 <li>Over</li> 
  <ul> 
   <li><a href="http://localhost/speciaal.php">Wie zijn wij</a></li> 
   <li><a href="http://localhost/index.php?id=12">Geschiedenis</a></li> 
  </ul> 
 <li><a href="http://localhost/afbeeldingen.php">Afbeeldingen</a></li> 
 <li><a href="http://localhost/index.php?id=56">Contact</a></li> 
</ul>

I am desperated as I tried to make a code all night long and now I am clueless about how I could accomplish this system. As you can see is the page system in the menu above but I olso want to direct some menu links to other files on my webserver. I will be really thankful if somebody could post a sample code or put me in a easy direction accomplish my goal.

I do not know mutch yet about php.

4

1 に答える 1

0

多分これはあなたが探しているものです: http://crisp.tweakblogs.net/blog/317/formatting-a-multi-level-menu-using-only-one-query.html

于 2012-04-09T15:57:12.933 に答える