Hi
I have problem in creating foreign keys in mysql.
I created the tables first. Then used the "Alter Table"
command to associate a foreign key.
"alter table answer add foreign key(QId) references query (QId);"
The command was executed successfully.
But when I used the "show create table answer" command,
I couldnt find the created foreifn key.
The screen output was like following..
------------------------------------------------------
| answer | CREATE TABLE `answer` (
`AId` int(11) NOT NULL default '0',
`QId` int(11) default NULL,
`AnsweredBy` text,
`Answereddate` date default NULL,
PRIMARY KEY (`AId`)
) TYPE=MyISAM |
-------------------------------------------------------
So I think the key was not created.
Can anyone help me in this.
I am using mysql4.1, Windows Xp home edition.
Ramesh.