Hi,
I am trying to create a form that will generate checkboxes for the items in a search. The results of the search are coming from two tables in a mysql database. The number of results is undetermined, and each result has a unique identifier. So when the results appear with checkboxes, an administrator can check whichever results they choose, and send the information from those checked results to three places: input into a third table in the database with the unique identifier (it's really an authorization process), print (echo) selected items out on a confirmation page when hitting submit, and email checked items to accounting dept.
The problem I am having is that instead of looping through and putting multiple rows in the database for each result that is checked by the administrator, only the last loop of results is going through to the database.
Here is my code:
<FORM ACTION="x.php" METHOD="POST">
//SQL STATEMENT 1 2 Fetch Results from table 1
while ($list = mysql_fetch_array($set1)) {
//SQL STATEMENT 2 Fetch Results from table 2
if (mysql_num_rows($rset2) > 0) {
<input type='hidden' name='x' value='$id'>
<input type='checkbox' name='auth' value='Yes'>
<input type='checkbox' name='auth' value='No'>
}
}
<input type='submit' NAME='submit' value='Send Selected Information'>
Thank you for your help!!