I have a small problem :) I was searching the web but didn\'t find any solutions.
I have a value like this (got it from $_GET[])
tag1, tag2, tag3, tag4
I would convert your comma-delimited tags into an array, then loop through the array to do your inserts.
$data_array=explode(",",$tag); // converts tags to an array based on the comma
// loop through each item in the array
foreach($data_array as $one_tag){
// Get rid of the space you have in your tag string
$one_tag=trim($one_tag);
// Do whatever sanitization you need to do to your data, for example...
$one_tag=mysql_real_escape_string($one_tag);
// Insert into the database
mysql_query("INSERT INTO table SET tag='$one_tag'");
}
You can make this more efficient using Prepared Statements, but it kept this example simple.