Preforming Math Operations on Database
Posted: Sat Oct 22, 2005 3:50 pm
First I have to say I'm very much a noob at php and mysql...so sorry if this question is really dumb.
I'm just messin' around and I'm trying to make a page that calculates my gpa. I have my my grade and number of hours per class in a data base. How can I preform operations on the values?
I'm really not sure how to set this up. I know I need to find the average of hours times grade. Is there anything thing like:
Also, if possible does anyone have a good links to tutorials of the kind of thing I'm trying to do.
Thanks.
Tim Brown
I'm just messin' around and I'm trying to make a page that calculates my gpa. I have my my grade and number of hours per class in a data base. How can I preform operations on the values?
I'm really not sure how to set this up. I know I need to find the average of hours times grade. Is there anything thing like:
Code: Select all
average($row['grade'] * $row['hour'])Thanks.
Tim Brown