Skip to content
Advertisement

Create Json array from mysql data

I need a bit of help, i have this code:

JavaScript

which is returning

JavaScript

and i need to return like this:

JavaScript

Could someone helping me? I search everywhere but i don’t see how to adjust array to get needed structure

Advertisement

Answer

You’re adding an extra array layer with the []. Change the code to this:

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