Hi all,
I am currently having trouble outputting a serialized array from a mysql database. The serialized data in the database comes from a series of checkboxes:
<?
for($i=0; $i < 8; $i++)
{
?>
<tr>
<td width="150" align="right">Item <? echo $i+1 ?></td>
<td><input type="checkbox" name="left_col_function[]" value="<? echo $i+1 ?>" <? if(whatever == '1') echo 'checked' ?>></td>
</tr>
<?
}
?>
....and this is my query:
$query_left_col_functions = mysql_query("select left_col_functions from cart_html");
while($row = mysql_fetch_array($query_left_col_functions)){
$left_col_functions = unserialize($row['left_col_functions']);
}
What i want to be able to do is if any of the array values = any of the checkbox values i want it to be checked?
I've been playing around but to no avail.
Any help greatly appreciated.
Cheers,
macca