HOW DO I SET THE CHECKBOX "ND" IS CHECKED IF THE VALUE IN MYSQL IS 1?
<?php $select_PO=mysql_query("SELECT pono, nd, r, adj, no, am, ct, poyes, poyesp, pon FROM tb_po WHERE pono = '". $id ."' AND postatus !='Approved' AND pono NOT IN (SELECT pono FROM tb_postatus)", $conn); $count=mysql_num_rows($select_PO); if ($count == 1) { $row=mysql_fetch_array($select_PO); if ($row['nd'] = 1) { $nd="checked" ; } if ($row['r'] = 1) { $nd="checked" ; } mysql_close($conn); ?><input type="checkbox" id="nd" name="nd" checked="<?php echo $nd ?> "/>
Aucun commentaire:
Enregistrer un commentaire