Jump to content

Elrohir

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Elrohir

  1. Hi, I searched the net and I went through a lot but I never found what I need so I turn for help to you: I have done a table viacerimi input / text input and / chcekbox. the checkboxes need to make yourself zaskrtavali based on the value in the database. Thus, if the db find the values ​​for example: when a db Table WAIT and value where I wait so let tick checkbox wait, but if there are defaults does so remains unchecked, further value if I say so in a well-tick the checkbox well and carried. <?php include ('../db.php'); $con="SELECT * FROM db_sn JOIN projekt ON db_sn.IDX=projekt.ID"; $vypis2=mysql_query($con) or die($con."<br/>".mysql_error()); $user_cats = array(); while ($id = mysql_fetch_row($vypis2)) { $user_cats[] = $id[0]; } $con1 = "SELECT IDx, waiting FROM db_sn"; $res = mysql_query($con1) or die($con1."<br/>".mysql_error()); $checkboxes = ''; while (list($id, $waiting) = mysql_fetch_row($res)) { if (in_array($id, $user_cats)) $checked = 'checked="checked"'; else $checked = ''; $checkboxes .= "<input type='checkbox' name='category[]' value='".$id."' /> ".$waiting."<br />"; } while ([color=#800000]$data[/color] = mysql_fetch_array([color=#800000]$vypis2[/color])){ ?> <td align="center"><?php echo($data['ok_meno']) ?></td> <td><input id="wait" type="checkbox" name="wait" value="wait" /></td> <td><input id="dobre" type="checkbox" name="dobre" value="dobre" /></td> <td><input id="odniest" type="checkbox" name="odniest" value="odniest" /></td> <?php } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.