Home / Web Development / HTML / SUM the table row values from mysql database – PHP

SUM the table row values from mysql database – PHP

Here I’m going to discuss about, how to add the table row values using php and mysql. This concept is very simple, we can fetch the data from database add/sum the column values. The values are inserted into database and fetch the values from database, and find the sum values by using SUM(column-name).
Code Explanation:
First, create the database and table ‘addtable’. The ‘addtable’ table contain three field, id,maths,english respectively.
The id is autoincrement and maths,english contain values like mark. Second fetch the data from database using mysql query:

firstadddtable

Second, performe the sum operatio using SUM(column-name).

finaladd

FULL CODE

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social Media Auto Publish Powered By : XYZScripts.com