MySQL Forums
Forum List  »  PHP

Posted by: BOb Vazoni
Date: July 26, 2017 04:07PM

I am selecting an aggregate function but i do not know how to reference it so it can be printed. sample below.
$sqlb = "SELECT name, count(score) as count FROM scores
where name = '$playername' group by name";
$resultb = mysqli_query($conn, $sqlb);
$rowb = $resultb->fetch_assoc() ;

if (mysqli_num_rows($resulta) > 0) { // output data of each row

// output data of each row

echo "<h1>" . $rowa["firstname"] . "&nbsp" . $rowa["lastname"]. "&nbsp" . "&nbspHometown: " . $rowa["home"]. "</h1>";
echo $rowa["firstname"] . " has played in " . $count . " events. See below for statistics." ;
echo "<tr><td>" . $rowa["bio"] . "<br>";}

have tried many ways, but unsuccessful....please excuse a newbie.

Options: ReplyQuote

Written By
July 26, 2017 04:07PM
July 27, 2017 08:16PM
July 28, 2017 09:46AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.