imsachinraut Posted October 14, 2014 Share Posted October 14, 2014 Hello group, I have query in "orders" table. Here "id" is "primary key" & in foreign key CONSTRAINT the same "id" has been made "foreign key" CONSTRAINT `fk_orders_user1` FOREIGN KEY(`id`) REFERENCES `users`(`id`) I feel its a typo, but the query executes smoothly & doesn't produce any error . In 'orders' table if the 'users_id' is foreign key then the FK constraint clause should have been as follows. CONSTRAINT `fk_orders_user1` FOREIGN KEY(`users_id`) REFERENCES `users`(`id`) Am i right? regards Sachin Raut Link to comment Share on other sites More sharing options...
Larry Posted October 31, 2014 Share Posted October 31, 2014 I believe you're right. I'll double-check. Thanks! Link to comment Share on other sites More sharing options...
imsachinraut Posted November 6, 2014 Author Share Posted November 6, 2014 Thanks Sir. Link to comment Share on other sites More sharing options...
Recommended Posts