Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Help needed to add a calculation field on MySQL...

$
0
0

Hi all

 

Noob here! :)

 

I am busy writing a web app that posts fuel usage data  into a MySQL DB.

 

Some records get added into the DB on the day that the vehicle leave the site. This will include the 'OpenKM' field. On the return of the vehicle the 'CloseKM' gets updated (added) into the record. I would like to have 'Consump' field to contain (CloseKM-OpenKM)/(MillDiesel+OutDiesel)

 

I am trying to figure out SQL Triggers, is that what I need to use to have this working?

 

 

Any help would be greatly appreciated.

 

Consump_Calc.jpg


Viewing all articles
Browse latest Browse all 13200

Latest Images

Trending Articles



Latest Images