ikster Posted May 1, 2007 Share Posted May 1, 2007 Man, it's 5 in the morning, aint gotten anything done and here's why: ALTER TABLE quotations ADD CONSTRAINT FOREIGN KEY 'client_id' REFERENCES clients ('client_id') ON UPDATE CASCADE ON DELETE CASCADE and it's giving 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 ''client_id' REFERENCES clients ('client_id') ON UPDATE CASCAD What does this machine want from me!!!!!!!!!!!!!!????Please help... Link to comment https://forums.phpfreaks.com/topic/49391-aaarrgh-stupid-foreign-keys/ Share on other sites More sharing options...
ikster Posted May 1, 2007 Author Share Posted May 1, 2007 Ok, im sorry if it sounds a bit rude, but please someone tell me the right way to declare the foreign key attribute in this case. I'm using mysql 5.0 and im really in a fix ti's really for me... Link to comment https://forums.phpfreaks.com/topic/49391-aaarrgh-stupid-foreign-keys/#findComment-242060 Share on other sites More sharing options...
bubblegum.anarchy Posted May 1, 2007 Share Posted May 1, 2007 I am unsure of the full syntax but the value client_id inside the brackets should not be quoted. Link to comment https://forums.phpfreaks.com/topic/49391-aaarrgh-stupid-foreign-keys/#findComment-242123 Share on other sites More sharing options...
trecool999 Posted May 1, 2007 Share Posted May 1, 2007 ALTER TABLE quotations ADD CONSTRAINT FOREIGN KEY client_id REFERENCES clients (client_id) ON UPDATE CASCADE ON DELETE CASCADE :-\ Link to comment https://forums.phpfreaks.com/topic/49391-aaarrgh-stupid-foreign-keys/#findComment-242673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.