<?php                     
$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(January) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$ja=$row['sum(January)'];
}
}else
{
$ja='0';
}



$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(February) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$fe=$row['sum(February)'];
}
}else
{
$fe='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(March) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$ma=$row['sum(March)'];
}
}else
{
$ma='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(April) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$ap=$row['sum(April)'];
}
}else
{
$ap='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(May) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$may=$row['sum(May)'];
}
}else
{
$may='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(June) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$ju=$row['sum(June)'];
}
}else
{
$ju='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(July) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$jul=$row['sum(July)'];
}
}else
{
$jul='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(August) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$au=$row['sum(August)'];
}
}else
{
$au='0';
}

$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(September) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$sep=$row['sum(September)'];
}
}else
{
$sep='0';
}

$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(October) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$oct=$row['sum(October)'];
}
}else
{
$oct='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(November) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$nov=$row['sum(November)'];
}
}else
{
$nov='0';
}


$sql = mysqli_query($con,"SELECT * FROM income where Year='$yr'");
$num=mysqli_fetch_array($sql);
if($num>0)
{
$result = mysqli_query($con,"SELECT sum(December) FROM income where Year='$yr'");
while($row = $result->fetch_assoc()) 
{
$de=$row['sum(December)'];
}
}else
{
$de='0';
}

?>