I am developing a system where i need this:
- I have various rows on one table, and one of them is Total
- I want the script that can add the total of all the fields in the Total column.
- I will then add the session user so that it only calculates all total fields in that column for that particular person.
You can get me the query: Example the search query for 30 days is this
$query="SELECT *
FROM clientdata
WHERE ADDTime BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY) AND NOW()
AND member_id='" . $_SESSION['SESS_FIRST_NAME'] . "'";
So you can also add the session details on the code you post below