In PHP
How can I average a column where another column is a specific name. There will be several records for the same person in this table. I don't get any result here.
Eg:
$result = mysqli_query($con,"Select * FROM record WHERE Name='Alex'");
$avg = "SELECT Name='Alex', AVG(Q1) FROM record";
$average = mysqli_query($avg);
while($row = mysqli_fetch_array($average)){
echo $row['AVG(Q1)'];
}