4

Can I store array values in single column in MySQL? since I have an array and want to store in database like here is some stuff which I want to execute.

var meida_array=[];
var media_length=response.media.length;
for(var i=0;i<media_length;i++){
   var parsed = url.parse(response.media[i]['link']);
   meida_array.push(parsed.host + parsed.path)
}
for (var i = 0; i < meida_array.length; i++) {
   console.log(meida_array[i]);
}

I am getting the array but stuck in to store in database Thanks, in advance :)

1 Answer 1

7

Use Json stringify and store in database

var stringObj = JSON.stringify(meida_array);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.