Skip to content
Advertisement

How to get multiple tables and show them in JSON

I have these tables in MySql

JavaScript

The output should be like this

JavaScript

This code gives me data of one table only

JavaScript

I’m new with PHP so I hope someone shows me how can I do it like above. Thank You……………………………………………………………………………………………………………………

Advertisement

Answer

Please check the code below, I added explaination as comments to the code itself.

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