Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to store the multiple checkbox values to store in a single field. I use that link http://www.mindfiresolutions.com/Storing-array-data-to-MySQL-using-PHP-1296.php. But i dont get the result.Give Help to find that problem.

share|improve this question
1  
What result do you get? – eggyal Dec 26 '12 at 10:23
what result is getting inserted? – ganeshrj Dec 26 '12 at 10:24
It displays no values – manoranjani Dec 26 '12 at 10:25
Can you post your code so we that we can check where's the problem? – Glenn Dec 26 '12 at 10:26
show us your checkbox code please – ganeshrj Dec 26 '12 at 10:26
show 5 more comments

1 Answer

up vote 0 down vote accepted

Set your column as 'set' (specify the all possible values.) data type and than run the below query.

$comma_separated = implode(",", $values);
$insert_query = "INSERT INTO TABLE_NAME(col_name) VALUES('$comma_separated')";
$result_insert = mysql_query($insert_query);

I hope this will solve your problem.

share|improve this answer
That is working Nice..Thank U very much. – manoranjani Dec 26 '12 at 12:11

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.