Hi there seen as i have come a custom for asking for help here, i was wondering if any body could give me a basic example of a mathamatical function that calls array's from mysql to a php script and then does a basic maths sum with them. would appreciate the help with this
Thanks in Advance
Can anyone pl give me a basic example of mathfunction in php
Moderator: General Moderators
-
gpittingale
- Forum Newbie
- Posts: 12
- Joined: Fri Jan 23, 2009 5:58 am
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Can anyone pl give me a basic example of mathfunction in php
I'm not exactly sure what you are asking, but it is usually better to perform any calculations on the database than PHP.
A simple example being,
The equivilent in php, if you have an array of values is array_sum()
You need to be more specific in your question.
A simple example being,
Code: Select all
SELECT SUM(fieldname) FROM yourtableYou need to be more specific in your question.