开发者

Update MYSQL Table automatically with php when user updates the other table

开发者 https://www.devze.com 2023-02-22 08:44 出处:网络
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 t

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.

0

精彩评论

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