I just want to insert an array into a particular column inside the mysql table. I don't have any idea if it is possible. Is there any way to do it?
-
refer here:stackoverflow.com/questions/21389299/…greetal– greetal2021-12-10 05:05:19 +00:00Commented Dec 10, 2021 at 5:05
-
1You cannot store pure array but you will want to make it a string using json_encode and store it. eg json_encode($arr)abhiburk– abhiburk2021-12-10 05:08:00 +00:00Commented Dec 10, 2021 at 5:08
-
MySQL supports JSON datatype which can store JSON array (and in recent versions it can even index such array if the array data is integers).Akina– Akina2021-12-10 06:30:14 +00:00Commented Dec 10, 2021 at 6:30
-
Does this answer your question? "Optimal Way to Store/Retrieve Array in Table", "How to store an array into mysql?", or possibly "Insert array into database in a single row". There are already many, many variants of this question on SO. Please read the site's help articles, especially on asking good questions.outis– outis2021-12-10 07:22:28 +00:00Commented Dec 10, 2021 at 7:22
-
1Does this answer your question? Inserting an array into a mysql database columnHarpal Singh– Harpal Singh2021-12-16 09:44:21 +00:00Commented Dec 16, 2021 at 9:44
|
Show 1 more comment