PHP and Highcharts
<p>I'm using the code below to generate a pie chart. But I'm getting a blank page instead of a chart. </p>

<p>I couldn't find any error in the console, however.</p>

<p>How can I find if anything is missing? How can I debug my code in this case?</p>

<pre><code>&lt;?php
        $servername = "localhost";
        $username = "root";
        $password = "";
        $conn = new mysqli($servername, $username, $password);
        // Check connection
        if ($conn-&gt;connect_error) {
            die("Connection failed: " . $conn-&gt;connect_error);
        } 
        $query = "SELECT name, val FROM wfss.web_marketing";
        $result = mysqli_query($conn , $query);
        if ($result) {
        echo "&lt;/br&gt;"."Results Found";
        // Conversion of result object into JSON format
        $rows = array();
        while($r = mysqli_fetch_array($result,MYSQLI_NUM)) {
            $row[0] = $r[0];
            $row[1] = $r[1];
            array_push($rows,$row);
        }
        print json_encode($rows, JSON_NUMERIC_CHECK);

        } else {
            echo "No Results Found";
        }

        mysqli_close($conn);
?&gt;  


&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="http://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt;
&lt;script src="http://code.highcharts.com/modules/exporting.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
        var options = {
            chart: {
                renderTo: 'container',
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: 'Web Sales &amp; Marketing Efforts'
            },
            tooltip: {
                formatter: function() {
                    return '&lt;b&gt;'+ this.point.name +'&lt;/b&gt;: '+ this.percentage +' %';
                }
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        color: '#000000',
                        connectorColor: '#000000',
                        formatter: function() {
                            return '&lt;b&gt;'+ this.point.name +'&lt;/b&gt;: '+ this.percentage +' %';
                        }
                    }
                }
            },
            series: [{
                type: 'pie',
                name: 'Browser share',
                data: [&lt;?php echo json_encode($rows)?&gt; ]
            }]
        }
    });   

&lt;/script&gt;
&lt;div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
</code></pre>