Skip to content
Advertisement

SQL query JSON of MySQL 8.0 comes String instead of Array

I create a table in MySQL 8.0 as follows:

JavaScript

It contains JSON type data, and I insert some data as:

JavaScript

And I use php to visit the database, I wish to get value of “airline” as an Array.

JavaScript

But it comes out a String, NOT an Array! This really annoys me, and JSON in MySQL is hard to understand.

Advertisement

Answer

Have you considered decoding JSON?

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