Home Forums Chart Support Creating Dynamic Graphs on a PHP page based off MySQL data Reply To: Creating Dynamic Graphs on a PHP page based off MySQL data

#19892

@lindsay10c,

Based on the sample project shared by you the SQL query used seems to have some issues. Comparing timestamp properly should work fine in your case, i.e. SELECT timestamp, count FROM skelCount WHERE timestamp >= TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 day)) should work fine in this scenario. Please take a look at this StackOverflow link for more information on fetching data n days ago.

Also, kindly take a look at the updated project. Below is the screenshot of the chart when its run in local-server.

CanvasJS Chart in PHP

___________
Indranil Deo
Team CanvasJS