Hello, i have a problem how to make to apear Top Billed Cast all with his photo, json is working but credits and variables it is the same on every character.
Can't find a movie or TV show? Login to create it.
Elementu hau kalifikatu edo zerrenda batera gehitzea nahi al duzu?
Ez zara kidea?
Travis Bell Erabiltzailearen Erantzuna
Azaroa 9, 2016 egunean 11:07 AM(e)tan
Hi @seedfile
If you query the /movie/credits all you need to do is iterate over the
cast
array. Each item contains the person, character name and profile image for the movie.Here's some quick Ruby code showing you the first 4 credits from Fight Club (just as an example):
seedfile Erabiltzailearen Erantzuna
Azaroa 9, 2016 egunean 11:36 AM(e)tan
I have writed this code....
and didn't working...
Travis Bell Erabiltzailearen Erantzuna
Azaroa 9, 2016 egunean 11:47 AM(e)tan
Take a look at the response you're getting back, there is no key called
credits_id
in the root of the JSON object. You need to first access thecast
array, then iterate over each item like I did above .seedfile Erabiltzailearen Erantzuna
Azaroa 9, 2016 egunean 12:47 PM(e)tan
echo $movcredits["cast"][0];
dind't work, have you another php solution like my?
Travis Bell Erabiltzailearen Erantzuna
Azaroa 9, 2016 egunean 12:55 PM(e)tan
I don't know PHP, so I can't be very helpful with that. There's 2 things I suggest at this point:
Cheers.