开发者

Attentance management using MySQL Procedure how to do?

I need to 开发者_StackOverflowdevelop a SQL Procedure,i am having 2 table one,with following details

userid

h1

h2

h3

h4

h5

h6

h7

date

and another table with following details

useid

per

why i need a procedure,because, the data to the first table is of follows

userid h1 h2 h3 h4 h5 h6 h7 date

1 p p p p p p p 2010-10-10

while data is updated in the table like new insertion or updation on the table the value in the table 2 should be updated

consider value of table2 is

userid per

1 50

it should be updated, the formula for update is (no of workhours-total hours end)/total no of work hours

how can i do this in MySQL,and how can i use the procedure in PHP?


you can use trigger in MySQL instead of procedure. The trigger will be called after insert or update action. In my experience, I only use store procedure with some complex database manipulation or make a transaction.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜