简体   繁体   中英

how to get a count of adding records in another table

i'm developing a product management system. in my project there is two modules as products(which is using tbl_product table in DB & have a column named as count) & supply(which is using tbl_supply table in DB).

the thing which i wanted to know is how to increase the count of the products in the tbl-product when inserting products using supply module.

i wrote the insert function but i couldn't write the update function to increase the count

if someone can help to solve this i'll be very thankful

When you add a supply in table. Run a query to increase count = count + 1 Like that.

UPDATE tbl_product SET count=count+1 WHERE product_id=product_id

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM