0

I have Json data in one of my columns (student_data) from table named data. The json data is as such:

[{"student_id":"1001","student_name":"patroclus","student_course":"medicine"},
 {"student_id":"1002","student_name":"achilles","student_course":"acrhery"}]

I want to extract the student_name from this data, but I couldn't do it. I'm using phpmyadmin to access my database.

I tried using the following query:

SELECT JSON_EXTRACT(`student_data`, '$.student_name') AS student_name FROM `data`;

The error from MySQL says:

#1305 - FUNCTION data.JSON_EXTRACT does not exist

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
  • What's your MySQL version? Those functions were only introduced in 5.7 – Nick Feb 24 '23 at 03:33
  • mine is 5.6.51. Is there any alternative for my version? –  Feb 24 '23 at 03:36
  • Sadly no. That version is no longer in support and you really should upgrade, preferably to version 8 as 5.7 will end support later this year. – Nick Feb 24 '23 at 03:41

0 Answers0