under lname there are 3 names , and each time when adding products these names and values insert in to other table, from there i want to sum by grouping the names,also how to arrange it by limiting the date and by person name.
riyas 1/1/2016 - car = 1
sara 2/1/2016 - bike = 2
riyas 3/1/2016 - car = 1
riyas 4/1/2016 - cycle = 10
sara 5/1/2016 - bike = 2
eg : car = 2 , bike = 4, cycle = 10
<?php <$query_check_credentials = "SELECT lname SUM(af) AS total_amount FROM customer GROUP BY lname";$result = mysql_query($query_check_credentials); while($row = mysql_fetch_array( $result )){echo $row['total_amount'];}?>