Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define a table to store JSON objects in MySQL database?

I want to store a JSON object in MySQL database(using xampp with mariadb). What should be the data type to store? It gives error if 'json' is used as data type.

like image 636
Sidath Asiri Avatar asked Nov 19 '25 03:11

Sidath Asiri


1 Answers

Solution is to convert json to string and save as text and re-convert to json after retrieving from database

like image 173
Sidath Asiri Avatar answered Nov 20 '25 18:11

Sidath Asiri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!