PHP maths (should be simple)

In my database i have rows of job costs, is there a way that i can add them up when people search on my site to give total.

example. searched jobs from monday to friday - each job cost was £1

how could i get php to add them up to = £5 as there a five jobs =£1.

anyhelp??

This should do the trick:

[php]$job_price = 1;

$query = mysql_query('SELECT COUNT(*) FROM jobs_table');

$cost = $job_price * mysql_result($query);[/php]

NICE! used that and went with this. PERFECTO!

SELECT veh_reg, COUNT(*) AS Jobs, sum(job_cost) AS Cost, avg(job_cost) AS Avg_Cost FROM daybook_db WHERE veh_date >=('$fromdate') AND veh_date <= ('$todate') GROUP BY veh_reg"
Sponsor our Newsletter | Privacy Policy | Terms of Service