Hi,
Can anyone tell me that how to insert the multiple comma separated values of Text Area field in MySQL database using php. As i want to take each value from the Text Area and then insert into the MySQL one after one. Can anyone provide small code for this. Thanks in advance.
How to insert comma separated values of textarea in mysql
Moderator: General Moderators
Re: How to insert comma separated values of textarea in mysql
Look into explode() and foreach().
Re: How to insert comma separated values of textarea in mysql
Hi phphunger,
Output of the php code above:
this, script, explodes, words, one, by, one, and, print, each, in, comma, seperated, form.,
Bye
Code: Select all
<?php
$textarea ="this script explodes words one by one and print each in comma seperated form.";
$textarea_array= explode(" ",$textarea);
for($i=0;$i<count($textarea_array);$i++) {
echo $textarea_array[$i].', ';
}
?>this, script, explodes, words, one, by, one, and, print, each, in, comma, seperated, form.,
Bye
Re: How to insert comma separated values of textarea in mysql
Thanks mates...Thank you for your solution...
Cheers...
Cheers...