figure 1. sum all value of money
id date name money //sample items only
1 March 5 2014 matt 50 //records to add
2 March 5 2014 john 10 //records to add
3 March 2 2014 matt 50 //records to add
figure 2. sum all value of money when search matt
id date name money //sample items only
1 March 5 2014 matt 50 //records to add
2 March 5 2014 john 10
3 March 2 2014 matt 50 //records to add
Hi guys can you help me i dont know the code how to Add the rows value in my sql database.(see sample above)
i have this code which will count how many records i have
<input type="text" name="namesearch" size="5" tabindex="1" />
<input type="submit" name='click' value='Search' />
if(isset($_POST['click'])){
$name= $_POST['namesearch'];
$query = "SELECT COUNT(*) AS total FROM table WHERE name='$name'";
$result = mysql_query($query);
$values = mysql_fetch_assoc($result);
$num_item= $values['total'];
echo "Number of Records Found # ".$num_item;