holz_bee Posted March 27, 2007 Share Posted March 27, 2007 hello i have been fiddling around with this for hours and got no where so i hope someon can help. i have created a customer table CREATE TABLE CUSTOMER (Customer_ID VARCHAR(30) NOT NULL, First_name CHAR (30) NOT NULL, Last_name CHAR (30) NOT NULL, E_mail VARCHAR (50), Address_1 CHAR(30) NOT NULL, Address_2 CHAR (30) NOT NULL, Address_3 CHAR (30) NOT NULL, Post_Code CHAR (6) NOT NULL, Telephone VARCHAR(13), Password VARCHAR (30) NOT NULL, AVATAR VARCHAR (200), Notes TEXT, Constraint Pk_Customer Primary Key(Customer_ID)) TYPE = INNODB; and it worked fine then i made a second table CREATE TABLE ORDER (Order_ID CHAR(10) NOT NULL, Customer_ID VARCHAR(30) NOT NULL, Constraint Pk_Ord Primary Key(Order_ID), INDEX ( Customer_ID ), Constraint FK_Ord FOREIGN KEY (Customer_ID) REFERENCES CUSTOMER( Customer_ID ) ON DELETE CASCADE) TYPE = INNODB; and i wont add even if i delete the FK! i have then managed to make a table and tryed to alter it using ALTER TABLE ORDER ADD FOREIGN KEY (Customer_ID) REFERENCES CUSTOMER(Customer_ID); any help i will be so greatful! im using PHPmyadmin 2.9.2 Quote Link to comment 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.