Ciao a tutti, ultima cosa fatta, ma da errore alla riga dove faccio il confronto
$query_estr=mysql_query("SELECT * From pippo")
or die("errore nella query;".mysql_error());
$ultimo=mysql_fetch_object($query_estr);
//print $ultimo->optional; qua dentro ho testo1,testo2,testo3
$oper=explode(',',$ultimo->optional);
for($i=0; $i<count($oper); $i++)
{
print $oper[$i]; //qua dentro c'è testo1testo2testo3
}
$a_optional=array('testo1', 'testo2', 'testo3', 'testo4', 'testo5', 'testo6', 'testo7', 'testo8');
$check="";
$riga=1;
print"
<table cellpadding='0' cellspacing='0' border='0' bordercolor='#23D527'>";
for($f=0; $f<count($a_optional); $f++)
{
if($oper[$i]==$a_optional[$f])
{
$check="checked";
}
else
{
$check="";
}
if($riga == 1)
{
print"<tr>";
}
print"
<td width='200' class='testo'>
<input type='checkbox' name='$f' $check>$a_optional[$f]
</td>";
$riga++;
if($riga > 2)
{
print"</tr>";
$riga=1;
}
}
print"
</table>";