I don't think it has anything to do with sessions.
kevinsequeira is on to something.
I'm gonna develop a hierarchical menustructure for computer components (e-commerse). This menu will be created dynamically with calls to a DB.
A script then retrieves relevant inforamtion (from D😎, writes it to a file.
A javascript will be showing and hiding menues.
A working example can be found here: http://www.psdata.no/
Yes, I've allready ripped the javacode - but I still need a system for the component tree.
How can I make it logical. Let's try (so I can udnerstand).
1|HDD
1|IDE
1|5400rpm
2|7200rpm
2|SCSI
3|SATA
2|processor
1|Socket 370
1|Celeron
2|Pentium
2|Socket 478
3|Socket A
3|memory
4|motherboards
Now, If I click HDD, the id=1. If I click IDE, the id=11 and if I click 7200rpm the id=112?
Am I on to something?
How would I know what data to fetch from the DB though? I have to de-siffer what 112 means. Do I hardcode the structure somewhere? Or can this be done dynamically?
How would I create my DB for this? One table for HDD, one for CPU and so on? So the table for HDD would maybe look like:
| #id | item | type1 | type 2 | prod desc |
( lvl 1 lvl 2 lvl3 ) (level one is base)
001 | 1 | 1 | 1 | ->(5400rpm IDE HDD)
001 | 1 | 1 | 2 |
001 | 1 | 2 | 1 |
001 | 1 | 2 | 2 | ->(socket 370, celeron CPU)
But what if there is no level three?
It's late and I'm just a bit confused on how to create a LOGICAL database - whuch may require PHP calls like main.php?id=121.