Display data from a SQL Server 2008 stored procedure in PHP

0

Good afternoon everyone,

I need to make 3 graphs with data from a SQL Server 2008 database, this data is subtracted from 3 stored procedures respectively and since the solution is only one page with the 3 graphics joined in 1 large one, I decided to use php + xampp + chartjs.

Within these requirements, I also need that the web page is constantly refreshing the data since they are updated throughout the day, so here I have some doubts:

  • To get the data returned by a sql server SP and capture it in php, do I need a library or something else?
  • Is it possible for example to bring SQL Server information, transform it into a JSON for example and then read it by chartjs ?, if so, how could it be?.
  • What else, library, driver, etc., do I need to connect SQL Server with xampp and PHP respectively?
  • I do not know if another web technology like Nodejs, for example, would be a better solution and faster, in this case I can choose in which to develop, since the only requirement is to use the DB in SQL Server.

    Any idea is super welcome.

    Thank you in advance!

        
    asked by Jordan Blake Told 30.09.2018 в 21:40
    source

    1 answer

    1

    To get the data returned by a sql server SP and capture it in php, do I need a library or something else?

    First you should set up your php and the sqlserver so that they interact ... on the internet there are many tutorialed that could serve you ... in the same way the most important or among the most important we have the following :

    1- Download SQLSRV32.exe (copy: php_sqlsrv_56_ts.dll, php_pdo_sqlsrv_56_ts.dll) in the path: C: \ XAMPP \ PHP \ EXT \ 2- Another important information is to install SQL Server ODBC Driver 11 for SQL Server, according to version 32bit or 64bit of S.O. Windows.

    Is it possible for example to bring the information from SQL Server, transform them into a JSON for example and then read them by chartjs ?, if so, how could it be?.

    In my humble opinion is what you should do ... JSON could serve you if in the future you decide to change database management and JSON is a universal structure that could help you in this case .. .as an example. This page could help you in what you are looking for: link

    I hope you serve comment any news and we give you a hand.

    Greetings

        
    answered by 30.09.2018 / 22:46
    source