Hi folks,
I am having problems getting this to work 🙁
I have a column (var text) in my mysql database for the list of sizes available, it lists them in the format of 'red,green,blue'
I was hoping to be able to autofill the select fields in my form using something like this:
$query = mysql_query("SELECT size FROM products WHERE `id`='$id'");
echo "<select name=option1>";
while ($r = mysql_fetch_array($query))
{
$size = fgetcsv$r["size"];
echo "<option value=$size>$size</option>";
}
echo "</select>";
Of course it isnt working as the returned result is one field, with the value of red,green,blue.
I assume I need to use something like the php file read csv function:
fgetcsv
??
Or should I be storing the colors in a different format in the DB ?