connection to database problem


#1

how to connect to my database php with google chart… database name=person_detail, table=gender, type=(1)girl , (2)boy, data (2,5)… not working and donknow why :disappointed_relieved:

<?php $dbhandle = new mysqli('localhost','root','','person_detail'); echo $dbhandle->connect_error; $query = "SELECT * FROM gender"; $res = $dbhandle->query($query); ?> google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart);
  function drawChart() {

    var data = google.visualization.arrayToDataTable([
      ['girl', 'boy'],
      
      <?php 

while($row=$res->fetch_assoc())
{
echo “[’”.$row[‘sum(girl)’]."’,".$row[‘sum(boy)’]."],";
}

      ?>

    ]);

    var options = {
      title: 'Gender Statistic',
      is3D:true,
    };

    var chart = new google.visualization.PieChart(document.getElementById('piechart'));

    chart.draw(data, options);
  }
</script>

#2

i already solve tq…