I have the following setup which stores my navigation for my Content Management System im creating. I want to extract the results so they print something like this: (PHP & mySQL)
Section Name
Now im struggling to select this by a single query so I can interate each row and print it, can it be done, if so how?
Basically need a 2D array to interate over?
Here are the tables:
Thx
Section Name
- <a href="?&id=LinkID">SubSection Name</a>
- <a href="?&id=LinkID">SubSection Name</a>
- <a href="?&id=LinkID">SubSection Name</a>
- <a href="?&id=LinkID">SubSection Name</a>
Now im struggling to select this by a single query so I can interate each row and print it, can it be done, if so how?
Basically need a 2D array to interate over?
Here are the tables:
CREATE TABLE sections (
sectionid int(10) NOT NULL auto_increment,
name varchar(64) NOT NULL,
PRIMARY KEY(sectionid)
) ENGINE = InnoDB;
CREATE TABLE subsections (
subsectionid int(10) NOT NULL auto_increment,
sectionid int(10) NOT NULL,
linkid int(10) NOT NULL,
name varchar(64) NOT NULL,
PRIMARY KEY (subsectionid),
FOREIGN KEY (sectionid) REFERENCES sections (sectionid),
FOREIGN KEY (linkid) REFERENCES links (linkid)
) ENGINE = InnoDB;
The links table I havnt created yet...
Thx
Last edited: