开发者

Write codes for foreign keys of this db (MySQL)?

My db structure is as below and I also have some data. How do I specify foreign keys using the MyIASM engine?

I have read the MySQL webisite, but because I am afraid of making errors I am asking you to show me an example.

My db structure:

tb_categories|cat_id(pk) , catname , parent_id
tb_articles|article_id(pk) , title , subtitle , textbody ,  date , remark
tb_articles_categories|id(PK) article_id(fk) , cat_id(fk)
tb_phptos|photo_id(pk) , photofilename , article_id(fk)
tb_articles_photo|article_id(fk) , photo_id(fk)
tb_tags|tag_id(pk) , tagname
tb_articles_tags|id(PK) article_id(fk) , tag_id(fk)


MyISAM does not support foreign key constraints, so you don't.


MyISAM does not support foreign keys. Only InnoDB does.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜