Skip to content
Advertisement

Problem with update database from API in Laravel PHP

I have a database of items, now I need to update the pictures in 10,000 records in the database, I make an API request, I receive an answer, but I just cannot process the answer correctly.

I received result:

JavaScript

And i need compare the name, and write in database icon_url value.

But always i received error:

Undefined array key "items" in:

JavaScript

My code:

JavaScript

How i can fix it? Hope for your help!

Advertisement

Answer

You forgot the result. The items key is in the result.

JavaScript

So, you have to replace it with:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement