If you have a way to decide which checkboxes have to be checked, just set its attribute like the line bellow: <INPUT TYPE="checkbox" NAME="" <?PHP if($condition) echo("CHECKED");?> > HTH Jayme. -----Mensagem Original----- De: jester <[EMAIL PROTECTED]> Para: <[EMAIL PROTECTED]> Enviada em: quarta-feira, 7 de março de 2001 14:00 Assunto: [PHP-DB] (Newbie) how to evaluate a varying number of db generated checkboxes? > I'm generating a html form with php and a MySQL database. > My code generates a varying number of checkboxes depending on the number of > 'options' in my database. The name of the checkbox is set to the -id- of the > 'option' in my database. When the generated form is posted I want to show a > page showing a overview of the 'options' checked. But how do I check if that > varying number of checkboxes is 'checked' ?? > > > db connect and query, result of query is placed in: $result ............. > > while($row=mysql_fetch_array($result)) > { > print("<form method=\"post\" action=\"formhandler.php\">"); > $optionID=$row["id"]; > $optionDescription=$row["description"]; > print("<input type=\"checkbox\" name=\"$optionID\"> > $optionDescription<br>\n"); > print("</form>"); > } > > > But how can I get this 'unknown' number of checkboxes in my next page and > evaluate if they are checked so I can leave out the unchecked ones in my > overview. > > > > > Who can help me with this problem?! > > Thanx! > H. de Visser > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]