Linking tables with mysql
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.
精彩评论