helo

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

helo

Post by jauson »

hi I have a problem, what mysql script should I use on this.

assuming i have 2 tables

total used is 4, total left is 1 its like dfference script


table_used
4


table_left
5(default)
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: helo

Post by Celauran »

Could you try to elaborate on that a little, please? It's unclear what you're trying to do.
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

Re: helo

Post by jauson »

im trying to create two tables for my system.

table1
empID = 001
date = 11/15/2011
sickleave = 1
vacationleave =
holiday =


date = 11/16/2011
empID = 001
sickleave = 1
vacationleave = 1
holiday =

date = 11/17/2011
empID = 001
sickleave = 1
vacationleave = 1
holiday = 1

I want my data in table 1 to subtract in my table2.

table2(this is default total leave per employee.)
empID = 1
sickleave = 5
vacationleave = 5
holiday = 5

the result will look like this


empID | date | Sick Leave | Vacation Leave | Holiday |
001 11/15/2011 1
001 11/16/2011 1
001 11/17/2011 1


Reserve Sick Leave | 4
REserve Vacation Leave | 4
Reserve Holiday Leave | 4
Post Reply