php - Mysqli SUM(row count *20) -
i've searched high , low answer 1 , have managed confuse myself further.
what need quite simple: $row2 row count of 'agent_name' , 'office' belongs particular group defined in table, functions expected, need $paygtotal display sum of count *20
i managed create complex join establish true count , i'm stuck on simple sum()
if simple $paygtyotal = [$row2[0] *20]
$paygcount = "select count(*) enabled_boards agent_name='$paygagent' , office='$paygoffice' "; $query = mysqli_query($conn, $paygcount) or die (mysqli_error()); $row2 = mysqli_fetch_row($query); mysqli_free_result($query); **$paygtotal = ???** $payglist.='<div id="payga" class="fluid">' . $paygagent . '</div> <div id="paygo" class="fluid">' . $paygoffice . ' </div> <div id="paygc" class="fluid center">' . $row2[0] . '</div> <div id="paygt" class="fluid center">£ ' . $paygtotal . ' </div>'; } }else{ $payglist="<p>!! error !!.</p>"; }
use group by
function:
$paygcount = " select count(*) enabled_boards agent_name='$paygagent' , office='$paygoffice' group enabled_boards.id ";
Comments
Post a Comment