So I have this php file which have query thats extract data from the DB to draw it on a Chart (Note : I'm using Chart.js lib), btw the chart working fine but in order to pass the value to the chart I have to use json_encode() built-in function to move the array to the javascript side using AJAX to display the array value in the chart but I'm getting this error in the image below:
https://i.stack.imgur.com/B0DZH.png
My PHP code : https://pastebin.com/tNh18qGX
My HTML & JS code : https://pastebin.com/06k9xbe8
Thank you guys.
CodePudding user response:
Make sure that when you go to you're .php file the only value/text/anything displayed on the page is the json u want to be retrieve by the request.
