Skip to content
Advertisement

Nest JSON from MySQL using PHP

I have a MySQL query which returns the following table:

JavaScript

and I have to return, via PHP, a formatted JSON which looks like the following:

JavaScript

Basically, I need to nest the invitations inside each event.

Advertisement

Answer

Try this.

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