Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

hi guys me going to do some report in php with my sql this is my output that fetch by mysql

Receipt No. Regno   Vaccine    Name    Amount
2015100015  98007   DHLP               115.00
2015100022  80002   DHLP               115.00
2015100014  98005   MEGAVAC 6          115.00

                Grand Total 345.00

i need like this:

Receipt No. |   Regno | Vaccine Name |  Amount
2015100015  |   98007 | DHLP         |  115.00
2015100022  |   80002 | DHLP         |  115.00
                      | Total        |  230.00
2015100014  |  98005  | MEGAVAC 6    |  115.00
2015100014  |  98005  | MEGAVAC 6    |  115.00
                      | Total        |  230.00
Grand Total | 460.00  |

i need result like this group of data to report

share|improve this question
1  
This is not a do-my-work-for-free site. Add some code, showing your attempts, and possible errors and/or issues you are facing. –  mike O. 19 hours ago
    
What... Please clarify what you are trying to do and what the problem is –  Epodax 19 hours ago
    
mikeO, Epodax is write. Please show your code? –  anant kumar singh 19 hours ago
    
Here, read up on GROUP BY mysqltutorial.org/mysql-group-by.aspx and ORDER BY mysqltutorial.org/mysql-order-by and SUM() mysqltutorial.org/mysql-sum –  Fred -ii- 19 hours ago
    
During fetch take two counters one for itteration and other for sum. And put amount in sum and after two itteration display sum and make both counters to zero. –  SHAZ 19 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.