Thank you so much. That really helped. I'm still having some problems though. I have 3 tables: accountInformation, courses, and account_courses. I made the table account_courses to clear up a many to many. I can't seem to figure out how to write to it though.
accountInformation Table
Code:
CREATE TABLE accounts(
accountID int primary key not null auto_increment,
username varchar(25),
password varchar(20),
email varchar(30),
firstname varchar(20),
lastname varchar(20),
lastLogin timestamp DEFAULT 0);
courses Table
Code:
CREATE TABLE courses(
courseID int primary key not null auto_increment,
courseName varchar(25),
courseDescription text,
courseDepartment varchar(4),
courseStartTime time,
courseEndTime time,
courseSemester varchar(20),
courseBuilding varchar(20),
courseRoomNumber int
);
account_courses table
Code:
CREATE TABLE account_courses(
accountID INT NOT NULL,
courseID INT NOT NULL,
foreign key(accountID) references accountInformation(accountID),
foreign key(courseID) references courses(courseID),
primary key(accountID,courseID)
);
This is my php file where I am querying to get account and courses to write into the table account_courses. I'm trying to link them together so I can take care of a many to many.
Code:
<?php
/**
*/
require_once
$accountID = ( isset( $_GET['accountID'] ) ? $_GET['accountID'] : 0 );
/* short variable */
//$accountID = $_POST['accountID'];
$courseID = $_POST['course1'];
$query = "INSERT INTO account_courses VALUES('courseID')";
$result = query($query);
/*Return to Scheduler*/
echo '<a href="/1.1/addCoursePage">Add Another Course</a>.';
/* error checking */
Bookmarks