Score table

Score table data

INSERT INTO `score` VALUES (1,10),(2,40),(3,20),(4,9),(5,20);

Create a New Project

Create a new project folder and name it chartjs. Note! Feel free to name your project as per your choice. Inside the chartjs project folder create a subfolder and name it js. This will hold all the javascript files.

Moving the JS files in the js folder

Copy the Chart.min.js and jquery.min.js files inside the js folder that we created inside the chartjs project folder. And create an app.js file inside the js folder. This will contain all the javascript code that we are going to write for this project.

Create data.php file to fetch data from MySQL table

Create a new file data.php inside the chartjs folder. This file is going to contain php code that will fetch data from the score table and display it in JSON format.