Hi all, I am having a problem and hoping someone can give me a hand.
mysql_select_db($database_connectionname $connectionname);
$query_simplequeryname = "SELECT COUNT(*) field1, field2 FROM table GROUP BY field2 ORDER BY field1 ASC";
$simplequeryname = mysql_query($query_simplequeryname, $connectionname) or die(mysql_error());
$row_connectionname = mysql_fetch_assoc($connectionname);
$totalRows_connectionname = mysql_num_rows($connectionname);
trying to do this.
row #1
field 1 = 50
field 2= person1
row #2
field 1 = 40
field 2= person2
row 3
field 1 = 100
field 2= person1
How can I query so I get this result.
Field 1 we are adding up all the numbers by person1
ie... field 1= 150 by person 1
Group them together
person 1 has 150
person 2 has 40