Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi im writting a script for my coursework and I have run into a spot of trouble. Im not sure how to do linked queries, my tables are set up with primary keys and I have made sure there is always a field to link things together.
Heres a little example of one thing I need to do to get the idea across. Here are some tables.Code: Select all
CREATE TABLE `tt_lessons` (
`LessonID` INT NOT NULL AUTO_INCREMENT ,
`TeacherID` INT NOT NULL ,
`ClassRoomID` INT NOT NULL ,
`SubjectID` INT NOT NULL ,
`BlockID` INT NOT NULL ,
PRIMARY KEY ( `LessonID` )
);
CREATE TABLE `tt_teachers` (
`TeacherID` INT NOT NULL AUTO_INCREMENT ,
`TeacherName` TEXT NOT NULL ,
PRIMARY KEY ( `TeacherID` )
);If it helps Im using php but its more of a general sql question.
Thanks for the help, david
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]