You can get the total of requested items by a sql query, instead of a loop in php, like this:
$@!#$ = mysql_query("select sum(request) as total from r_date group by id");
while($pf = mysql_fetch_array($@!#$)) {
...
}
www.mysql.com and www.php.net are great resources.
enotalone wrote:
This forum is my lifesaver. new problem.
my r_date table has this structure:
id | request | pdate |
1 10 2001-11-12 |
2 5 2001-11-10 |
1 5 2001-11-10 |
- - - - - - - - - - - - - - |
now, how can i calculate the total for those items whose id=1 in this case the total should be 15 (10+5), but what code do i need. please if possible give me the whole querry code i am not fluent enough in php yet. thank you very much.
Regards
Arman Galstyan
eNotalone.com inc.