Setting foreign key in phpMyAdmin

I want to make namecon of table “paper” as a foreign key reference to table “journal” to its primary key jname. I am getting confused with this view and not finding any tutorial or link which is explaining to set foreign key with this schema of phpMyAdmin. (Is it new or what) Please someone let me to figure this out.

journal table has primary key which is “jname”. and paper table has an attribute “namecon”. now I want to set this “namecon” as foreing key.

run this query in the SQL tab –

ALTER TABLE paper ADD CONSTRAINT paper_journal FOREIGN KEY (namecon) REFERENCES journal (jname)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.