开发者

Linking tables with mysql

开发者 https://www.devze.com 2023-03-21 03:42 出处:网络
I want tables linked on MySQL, so that when any of three tables are changed the actual table 开发者_运维百科is changed, a bit like doing symlinks or pointers. How can this be done within MySQL? I will

I want tables linked on MySQL, so that when any of three tables are changed the actual table 开发者_运维百科is changed, a bit like doing symlinks or pointers. How can this be done within MySQL? I will be accessing it from php.


This could be achieved with database triggers: http://dev.mysql.com/doc/refman/5.0/en/triggers.html


There is no such native feature in MySQL, but you can accomplish it by writing triggers of your own.


You can use triggers, so that if one table is modified the others are updated. See MySQL triggers.

Or if the tables just use the same data, then you can have one 'real' table and the rest as views. See MySQL views.

0

精彩评论

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