Accepted answer

I believe your problem is in the order you included the scripts. Try placing jQuery first:

<script src=""       type="text/javascript"></script>
<script src=""></script>
<script src=""></script>

Demo (working / not working).

Update: to load your data from MySQL using PHP, please see this example. However, as you pointed out yourself, encoding it using JSON might be a better option:

$data = array();

while($row = mysql_fetch_array($results)) {
    $data[] = array($row[1], $row[0]);
echo json_encode($data);

This last echo can be used either to return the whole array using ajax (like the linked example above), or when generating the page itself (i.e. "hardcoding" it in the script):

    series: [{
        type: 'pie',
        name: 'Browser share',
        data: <?php echo json_encode($data)?> 

This will work since your array, when JSON encoded, can be used in place of a JavaScript literal (and the json_encode should take care of escaping everything, preventing XSS vulnerabilities).


The order of including javascripts should be:

<script src=""       type="text/javascript"></script> 
<script src=""></script>
<script src=""></script>

By this I mean, you have to include the jQuery library first before any other script.

Related Query

More Query from same tag