Skip to content
Advertisement

php pdo json encode array print

When I pull data from the hello database, it just writes the first line, not the other lines, what could be the reason? I did not know much about php json but did not get any results.

İD 88 NOT FOUND

**database print **

JavaScript

database data

JavaScript

database function

JavaScript

socialmedia foreach

JavaScript

database data

database print

Advertisement

Answer

You’re only returning the first element of each JSON array. Append the whole array to the result.

JavaScript

BTW, don’t use SELECT * if you only want the menu_content column. Use SELECT menu_content.

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