Forum Moderators: coopster
I use it to store the colours that each product is available in i.e. 'red,green,blue'
I need to send the content of this column to an array so that for each colour the product is available in I can output a radio button using the foreach function.
My code is:
$resultCol = mysql_query("SELECT colour FROM productsWHERE code='$id'");
while ($array = mysql_fetch_array($resultCol))
{
$data[] = $array[0];
}
echo '<pre>' . print_r($data, true) . '</pre>';
Array
(
[0] => blue,green,white
)
Array
(
[0] => blue
[1] => green
[2] => white
)