I need some help to resolve my issue. I did several investigations without any success. I have a table with a IsContrib column which is BOOLEAN. I want to display this column with my checkbox. If IsContrib=1 ==> checked else IsContrib=0 unchecked.
Here, how I did, but I get an error saying: syntax error, unexpected ';'
I trid to do like so:
echo "...
<td> <input name='checkboxNContrib[]' type='checkbox' id='checkboxNContrib[]' ".$rowNContribRunDis["IsNContrib"]==TRUE ? "checked='checked'"." value='".$rowNContribRunDis["IdVariantNContrib"]."'/> </td></tr>";
Here the whole echo:
while($rowNContribRunDis = mysqli_fetch_assoc($PerformNContribSELECT)){
$id = $rowNContribRunDis["IdVariantNContrib"];
echo "<tr>
<td> ".$rowNContribRunDis["ID"]." </td><td> ".$rowNContribRunDis["Reference"]." </td>
<td><textarea name='ResultHRM[$id]' id='ResultHRM[]' cols='30' rows='1'>".$rowNContribRunDis['ResultHRM']."</textarea></td>
<td><textarea name='Commentaires[$id]' id='Commentaires[]' cols='60' rows='1'>".$rowNContribRunDis['Commentaires']."</textarea></td>
<td> <input name='checkboxNContrib[]' type='checkbox' id='checkboxNContrib[]' ".$rowNContribRunDis["IsNContrib"]==TRUE ? "checked='checked'"." value='".$rowNContribRunDis["IdVariantNContrib"]."'/> </td></tr>";
Aucun commentaire:
Enregistrer un commentaire