hi,
i'm using implode to insert checkbox data as an array into database.. the input in the database is like this:
*Blue*Green*bla....
my checkbox code:
while ( $rows = mysql_fetch_assoc($result) ) {
print('<input type="checkbox" name="clr[]" value="'.$rows['id'].'">'.$rows['colour'].'');
}
Then I used implode to insert the data into database:
$insertC = '*'.implode('*',$_POST['colour']).'*';
$query = "INSERT INTO colors VALUES('$insertC')";
my problem is how do I retrieve the data for user to choose their most fav color in radio button form..the one that i did, it's display the data in 1 row..the code:
while ($row = mysql_fetch_array($result))
{
$c = $row['color'];
$array = array($c);
$d= implode(",", $array);
print('<input type="radio" name="color" value="'.$rows['colour'].'"> '.$d.'<br>');
}
result:
*Blue*Green*REd*
what i want is like this:
Blue
Green
Red
can anyone help me..i've been doing this for 2 days..