skyquek's avatar

How to save the json array data in database

Hi, does anyone know how to store the data in this format ["123"] in PHPMyAdmin?

Now the data I store into the database is only the value which is 123. I want to store the data like this ["123"]. Does anyone know how to do this?

Here is my code:

Company::create([
            'companyID' =>  $people->people_id,
        ]);
0 likes
1 reply
Tray2's avatar

Don't store anything in json format in the database, is my advice. It will bite you in the ass sooner or later.

Please or to participate in this conversation.