FIRST CREATE TWO TABLE USING FOLLOWING SYNTEX
TABLE 1:
CREATE TABEL DEMO1(ID INT(20) PRIMARY KEY,
NAME VARCHAR(20));
TABLE 2:
CREATE TABLE DEMO2(ID INT(20),
ADDRESS VARCHAR(20));
WHEN TWO TABLE ARE CREATED THAN GOTO SQL TAB IN PHP MYADMIN
THAN TYPE OR COPY FOLLOWING QUERY
ALTER TABLE `demo2` ADD FOREIGN KEY ( `id` ) REFERENCES `demo`.`demo1` (
`id`
) ON DELETE RESTRICT ON UPDATE RESTRICT ;
THAT'S IT
THIS WILL HELP YOU THAN LIKE IT AND COMMENT PLEASE....
No comments:
Post a Comment