计算列的总和(总计)并在PHP中按日期搜索

Here is sample of my sql table:

enter image description here

In above table:

1: id_problem is for user to enter an amount.

2: id_patient is unique ID

3: opening_date is about when user entered the amount.

4: rialamount is currency

How to add/sum total rialamount column and search it based on opening_date ??

For example: User will be able to enter a date until another date to see what's the total amount..

How cal I make it by using my sql table?

Thanks in advance

Please try this in your mysql:

SELECT sum(rialamount) FROM table_name WHERE opening_date = '2015-11-07' GROUP BY opening_date;