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... Quote 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... Quote 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. Quote 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 :-\ Quote Link to comment https://forums.phpfreaks.com/topic/49391-aaarrgh-stupid-foreign-keys/#findComment-242673 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.