how to insert multiple of values in a single field in mysql

i want to insert multiple values into a single field, i don’t know how to achieve this i’m using a long-text data type field.


Can you please tell me how can i solve this issue.

Junior Developer Asked on February 22, 2017 in MYSQL.
Add Comment
2 Answer(s)

Here is the code.You can try it.

<?php $dataarray=$_REQUEST['data'];


foreach($dataarray as $data)


$post_data.= $data.",";


$final_data=substr(trim($post_data), 0, -1);

$sql= "insert into tablename set post_data ='".$final_data."'";

Team Leader Answered on February 22, 2017.
Add Comment

Thanks. Its working for me.


Junior Developer Answered on February 25, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.