Quantcast
Channel: www.MastiCafe.In » Mysql
Viewing all articles
Browse latest Browse all 7

How to count data in a MySQL table using PHP?

0
0

Given the “Employees” table below:

—————————————————————
| Name | Hours Worked |
—————————————————————
| John | 5 |
| Bob | 3 |
| Jack | 2 |
| Jill | 7 |
| Jill | 1 |
—————————————————————

How does one go about writing PHP code to add up all of the hours in the table?

On top of that, how does one go about adding up all the hours of a particular person (example: Jill).


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images