In my last two articles I used only client-side technologies – JavaScript and jQuery – to create interactive charts. But more often than not the data you want to visualize is present in a database, and server-side code is needed to handle that. You need some sort of a way to pull that data directly from the database and feed it into the charting library for plotting a chart.

Today, I am going to solve exactly this problem. I will use PHP to pull data from a MySQL database and create an interactive chart using that data. For creating charts, I will use FusionCharts’ core JavaScript chart library and its PHP charts wrapper.