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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -