Hello
I开发者_如何学Go'll explain to you with an example.If an admin updates the admin
table, then some data is automatically added to the stock
table. And if a client submits a form to the sales
table, then also some parts of the data update automatically in the stock
table.
I mean I want some contents of the admin and sales tables in the stock table. I want to do the process with PHP.
You want to use either triggers, as Cybernate mentioned, or stored procedures to combine the two operations.
Triggers - http://dev.mysql.com/doc/refman/5.0/en/triggers.html
Stored Procedures - http://dev.mysql.com/tech-resources/articles/mysql-storedproc.html
If you want to do it in PHP only, simply add the update to the other table within whatever functions you are using.
精彩评论