|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
mysql tree
There is a table "menu"
| id | menu | parent_id | How to get like this Main Company ---- We ---- What Service ---- VIP --------- Very VIP --------- Bad Product ---- Computers and so on |
|
#2
|
|||
|
|||
|
Explain in plain English what it is you wish to store in the database, and how you'd like to retireive the info (eg, what will you be presenting from the database?) Once you do that, I'll know what it is precisely that you want and can help you.
|
|
#3
|
|||
|
|||
|
In database will be menu structure for site.
I'd like to make map of the site. Is it clear? |
|
#4
|
|||
|
|||
|
If it's a menu, why do you need it in a database? I don't see quite what you're trying to do. You don't put "design" in a database, you put data, or content and leave the actual design in your pages.
|
|
#5
|
|||
|
|||
|
This is what I did when I was creating a category tree. I first loaded all the entries into an array, then I used a recursive function for deciding which level each of the categories should be in, and in which order. It's actually pretty easy
![]()
__________________
Best Regards, Håvard Lindset |
|
#6
|
|||
|
|||
|
Lindset
Are you really from Alta, Norway? So, we are neighbour, I'm from Murmansk, Russian. I even was in Alta somewhen, 7-8 years ago. It was popular selling different Russian souvenirs in Norway. Best wishes! Quote:
I'm trying to do the same, but it's not clear for me now. |
|
#7
|
|||
|
|||
|
Quote:
Yep, I'm really from Alta, Norway ![]() I'm going to bed now, but I'll see if I can post an example tomorrow, all right? Presuming you're using PHP, that is.. ![]() |
|
#8
|
|||
|
|||
|
It will be nice to see an example.
I'm using PHP. |
|
#9
|
|||
|
|||
|
Quote:
PHP Code:
Good luck.. ![]() --- by HalitYEŞİL w w w . trteknik . n e t - w w w . mysqlturkiye . c o m |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > mysql tree |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|