Jump to content

How do I pull array from API into database?


jbass350z

Recommended Posts

I am not that great with PHP so I need some help pulling an array from an API into a MYSQL database. I guess the problem is two-fold:
 
1. How should the database tables be setup?
 
2. What is the php to actually perform the insert? I have tried cutting and pasting various code from around the internet but I always end up with errors.
 
Here is what is returned from the API:
 
        

    Array
    (
    [success] => 1
    [return] => Array
        (
            [0] => Array
                (
                    [a] => 22016931
                    [b] => 2014-02-07 15:35:17
                    [c] => 0.00000160
                    [d] => 10011.32572730
                    [e] => 0.01581789
                    [f] => Yes
                )


            [1] => Array
                (
                    [a] => 22016912
                    [b] => 2014-02-07 15:34:56
                    [c] => 0.00000159
                    [d] => 7100.05070406
                    [e] => 0.01121808
                    [f] => Yes
                )


            [2] => Array
                (
                    [a] => 22016911
                    [b] => 2014-02-07 15:34:56
                    [c] => 0.00000158
                    [d] => 13089.15960294
                    [e] => 0.02068087
                    [f] => No
                )




        )


    )
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.