Thursday, 22 August 2013

how to select and sum in single sql query

how to select and sum in single sql query

Is it possible or another solution to sum and select multiple rows in
single sql query and print with while looping like that:
$query = mysql_query("SELECT SUM(Total), * FROM table");
while ($fetch = mysql_fetch_row($query)) {
echo $fetch[a];
echo $fetch[b];
echo $fetch[c];
}

No comments:

Post a Comment