I currently have a html form which is being
dynamically created.
The page has a
<SELECT NAME="foo[]" MULTIPLE>
<?php
while ($webfeatures = mysql_fetch_array($result_feature))
{
print("<OPTION VALUE=\"$webfeatures[1]\">$webfeatures[0]\n");
}
?>
The data contained within the array foo are abbreviations such as: FEF IG FCH PK etc...
I need those abbreviations to be inputted into a column in a table
i.e. FEFIGFCHPK
I have tried various methods and have had no success. My last attempt was:
while(list($foo) = each($wspafeatures))
{
$update = "INSERT into spaserial (spaclass, spamonth, prodyear, dealer_id, seriesabbr, modelabbr, serialnum, features) VALUES ('$wspaclass', '$wprodmonth', '$wprodyear', '$wdealer', '$wseries', '$wmodel', NULL, '$wspafeatures')";
$result = mysql_query($update) or die("Unable to update your information. " . mysql_error());
}
Unfortunatly a new row gets generated for each feature. I have tried ltrim as well to see if I couldn't get all the data within the array foo to mesh together... no luck there either.
The only thought I have left is to output the contents of foo to a text file and use sed and awk to mesh everything into one group and then read it back in.. but that just seems ugly and a cheap hack to me.
Does anyone have any suggestions??