MDanz Posted January 4, 2011 Share Posted January 4, 2011 when i put this in phpmyadmin i get errors... can anyone look over it and find a mistake.. CREATE TABLE Student { SID int NOT NULL default, SNAME varchar(200) NOT NULL default, ADDRESS text NOT NULL default, POST_CODE varchar(10) NOT NULL default, PHOTO mediumblob NOT NULL default, Primary Key (SID) } ENGINE=INNODB CREATE TABLE Course { CID int NOT NULL default, CNAME varchar(200) NOT NULL default, DEPARTMENT text NOT NULL default, Primary Key (CID) } ENGINE=INNODB CREATE TABLE Student-Course { SID int NOT NULL default, CID int NOT NULL default, GRADE varchar(200) NOT NULL default, COMMENTS text NOT NULL default, Primary Key (SID,CID), FOREIGN KEY (CID) REFERENCES Course (CID) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (SID) REFERENCES Student (SID) ON UPDATE CASCADE ON DELETE CASCADE } ENGINE=INNODB Quote Link to comment https://forums.phpfreaks.com/topic/223335-help-with-mysql-table-structure/ Share on other sites More sharing options...
mikosiko Posted January 4, 2011 Share Posted January 4, 2011 the post is duplicated or you are using 2 identities? or are you both working in the same project? http://www.phpfreaks.com/forums/mysql-help/missing-foreign-key/ post what error are you getting... in details Quote Link to comment https://forums.phpfreaks.com/topic/223335-help-with-mysql-table-structure/#findComment-1154493 Share on other sites More sharing options...
MDanz Posted January 5, 2011 Author Share Posted January 5, 2011 CREATE TABLE Student{SID int( 8 ) NOT NULL AUTO_INCREMENT , SNAME varchar( 200 ) NOT NULL default, ADDRESS text NOT NULL default, POST_CODE varchar( 10 ) NOT NULL default, PHOTO mediumblob NOT NULL default, PRIMARY KEY ( SID ) } ENGINE = INNODB; for this i get this error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{ SID int( NOT NULL auto_increment, SNAME varchar(200) NOT NULL default, ' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/223335-help-with-mysql-table-structure/#findComment-1154970 Share on other sites More sharing options...
MDanz Posted January 5, 2011 Author Share Posted January 5, 2011 nvm Quote Link to comment https://forums.phpfreaks.com/topic/223335-help-with-mysql-table-structure/#findComment-1155008 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.