<?php

$con=mysqli_connect("localhost","root","","feedback_form") or die("connection failed");
$sql="select avg(q1) as avgq from tbl_contact;";
$res=mysqli_query($con,$sql);
echo"Average of Question 1: ";
if($res){
	$row=array();

	while($row=mysqli_fetch_assoc($res)){

		echo $row['avgq'];
	}
}

//questoin 2
	$sql="select avg(q2) as avgq from tbl_contact;";
$res=mysqli_query($con,$sql);
echo"<br>   Average of Question 2: ";
if($res){
	$row=array();

	while($row=mysqli_fetch_assoc($res)){

		echo $row['avgq'];
	}



}

?>