imsachinraut
-
Posts
3 -
Joined
-
Last visited
Posts posted by imsachinraut
-
-
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
-
hi all,
I am a newbie to database designing & web programming.
In 'orders' table, the FK constraint clause is as follows.
CONSTRAINT `fk_orders_user1` FOREIGN KEY(`id`)
REFERENCES `users`(`id`)
Is it a typo? Because 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 folks?
regards
Sachin Raut
Chapter 3 : Foreign Key In "orders" Table
in Effortless E-Commerce with PHP and MySQL (2nd Edition)
Posted
Thanks Sir.