#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    1
    Rep Power
    0

    Best practice using API


    Hi there,

    I'm building a movie website as a hobby project.
    I'm getting the data from the latest/upcoming/rated movies from an API.

    Now my question is if I should store the data I call from the API to a database using PHP or should I just use a GET request using javascript?
    What is the best practice?
  2. #2
  3. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,394
    Rep Power
    9645
    Those are two completely different things. I can't think of any situation where both of them would be acceptable - it's one or the other.

    Do you want to store the data on your server? Do it from PHP.
    Do you want to present the data to the user without it touching your server? Do it from Javascript. (Assuming they even provide a Javascript-based API you can use for it.)

IMN logo majestic logo threadwatch logo seochat tools logo