I can help with the splitting the code after each comma, I had a similar problem to this recently and came up with this solution (I couldnt put it in code tags because then it wouldnt highlight the bits that need changing):
//you will need code up here to get the former names into a variable called $former
$query=mysql_query("SELECT
former_name,
user_ID FROM
name_table");
while($row=mysql_fetch_array($query))
{
$former=$row['
former_name'];
$id=$row['
user_ID'];
//this removes the quotes
$former = str_replace('"', "", $former);
//this creates and array called $keys and each value is
//one of the former names that is split by the commas
$former = preg_split('/,/' , $former, -1 );
//this is an array loop that will put the separate values into a new table
foreach($former as $value)
{
//put some code here to enter values into database eg:
$query=mysql_query("
INSERT INTO new_table (`user_ID`, `name`) VALUES ('$id', '$value') ");
}
}
I have highlighted the code that you might need to change to suit your database.
I hope this helps
Hooray