Jump to content

ADD SUBTRACT PHP MYSQL (affecting database)


Edmhar

Recommended Posts

Hello. im gonna ask how i will make this happen.

i have  a  mysql database ( StockItem, in, out, availableitem)

add and subraction only

 

assuming that  I have value n my StockItem = 50 , in = 0  , out = 0 , availableitem =  ( have a computation of stockitem - in & availableitem + out )

so i will have form for ( in ) 

The IN AND OUT are USERINPUT it will have textbox that will input  the value by admin.
for example i input in FOR (in) textbox = 10 then click the button process it will update the whole table affecting all the field in that row
 

This can be done by creating a MySQL trigger.

When you update, insert, and/or delete from a table, a trigger (you must create first) is fired to execute some code that updates, inserts, and/or deletes from another.

 

http://dev.mysql.com/doc/refman/5.0/en/triggers.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.