@bharadhan,
Please take a look at this Gallery Page for an example on rendering chart with data retrieved from database in PHP. You can also download PHP Samples form our download page to run sample locally.
If you are still facing issue, kindly share sample project along with sample database over Google Drive or Onedrive so that we can look into the code, understand the scenario better and help you out.
—
Vishwas R
Team CanvasJS