Q:

PHP to Javascript passing variable returns null results

Here is the code that I have:
https://jsfiddle.net/a6kukf3n/
The PHP variable $weekParses contains the following data:
WK 14,WK 15,WK 16,WK 17,WK 18,WK 19,WK 20,WK 21,WK 22,WK 23,WK 24,WK 25,WK 26,WK 27,WK 28,WK 29,WK 30,WK 31,
However, when I add it to the var weekCases on Javascript and try to print it to the console or my charts.js file it returns null, 1, 2 ,3 ,4 etc
What am I doing wrong? How do I send my PHP variable to JS?

A:

Please create a new array in php and assign the value to array
$data_week=array();

while ($weeks = mysqli_fetch_row($numRowsQuery))
    {

      $data_week[]=$weeks

    }

After that please try 
<script type="text/javascript">  
    //pass php variable to js for open cases pw
    <?php $weekParse = $data_week; ?>
    var weekCases = <?php echo json_encode($weekParse); ?>; 
</script>

