dyncoder

PHP PDO/MySQL non-deprecated example

Recommended Posts

Hello is there an example with php pdo non-deprecated commands.

 

I found the following but it is written with deprecated coding.

 

http://www.fusioncharts.com/dev/using-with-server-side-languages/php/creating-charts-with-data-from-a-database.html

 

mysql_fetch_array — Fetch a result row as an associative array, a numeric ... This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0.

 

 

Please let me know, thanks.

 

 

Share this post


Link to post
Share on other sites

I wanted to add, I can get the following array results: Array ( [0] => Array ( [id] => 6 [Name] => John Smith [Pet] => Dog [Visits] => 5 [DateTime] => 11/26 22:24 ) ) using $results = $stm->fetchAll(PDO::FETCH_ASSOC); but unsure how to convert it into the following form for fusion charts:
 

    [
    {
    label: "CJ Anderson",
    value: "25"
    },
    {
    label: "Imran Tahir",
    value: "25"
    },
    ...
    ...
    ]

 

Edited by dyncoder

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now