diffenc Posted January 31, 2008 Share Posted January 31, 2008 It's been four years since I had to program PHP, so help I need! I'm needing to pull some information out of a database table, check to see if it's acceptable, manually flag it one way or another, and write to another database field a 1 or a 0 to indicate it has been reviewed and approved/denied. I've got my database set up, but I'm not knowing the best way to mark the stuff and push it back in as cleared. Using while($row = mysql_fetch_array($box1dist)) to get the results from my initial query and write them into an HTML table. I need, next to each result, a checkbox for yes and a checkbox for no to manually select and submit back into the database. echo "<form id=\"form1approval\" name=\"form1approval\" method=\"post\" action=\"runapproval.php\" ><table border='1'> <tr> <th>Box one result ("; echo $box1count; echo ")</th> <th>Approved?</th> </tr>"; while($row = mysql_fetch_array($box1dist)) { echo "<tr>"; echo "<td>" . $row['box1t'] . "</td>"; echo "<td>Correct <input type=\"checkbox\" id=\"yes\" name=\"yes\" \/> Error <input type=\"checkbox\" id=\"no\" name=\"no\" \/> </td>"; echo "</tr>"; } echo "</table><input type=\"submit\" name=\"submit\" value=\"submit\" \/></form>"; Help is much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/88781-updating-table-through-checkboxradio-and-form-submit/ Share on other sites More sharing options...
revraz Posted January 31, 2008 Share Posted January 31, 2008 From your description, just output the rows in a table format, on the field that you want to display the status, lets call it approved id | name | approved 1 | John | no 2 | Fred | yes Then display the row, make the no and yes a URL so when you click on it, it changes from no to yes or yes to no ? Quote Link to comment https://forums.phpfreaks.com/topic/88781-updating-table-through-checkboxradio-and-form-submit/#findComment-454730 Share on other sites More sharing options...
diffenc Posted January 31, 2008 Author Share Posted January 31, 2008 I'm actually going to run a filter first to see if the column for approval is NULL or not, and only return results back if it is NULL to be sorted. Once I flag a particular string as approved/disapproved and write it to that column, I'm comparing all new results to the approved/disapproved set. I basically am listing all unique column entries from the table that have not already been looked at, and need to push back a flag to the table saying it's been sorted and approved/not. Quote Link to comment https://forums.phpfreaks.com/topic/88781-updating-table-through-checkboxradio-and-form-submit/#findComment-454733 Share on other sites More sharing options...
revraz Posted January 31, 2008 Share Posted January 31, 2008 Maybe have one more field then called reviewed Quote Link to comment https://forums.phpfreaks.com/topic/88781-updating-table-through-checkboxradio-and-form-submit/#findComment-454734 Share on other sites More sharing options...
diffenc Posted January 31, 2008 Author Share Posted January 31, 2008 Yes, the review field exists (two actually, as I have to run this on two columns of entries) I am running a usability test on some forms going out to a reasonable amount of people. I'm giving them information and asking them to populate a series of forms to find out where they are putting bits of data to submit. I am then stripping punctuation, converting them to lowercase, and writing it to the db in a new column. Next, I'm selecting all the unique strings from that column for this approval check through an HTML page my tester will use. Once a string is marked approved/unapproved and sent back to the table, that string never needs checking again. Quote Link to comment https://forums.phpfreaks.com/topic/88781-updating-table-through-checkboxradio-and-form-submit/#findComment-454738 Share on other sites More sharing options...
diffenc Posted January 31, 2008 Author Share Posted January 31, 2008 maybe this will help http://chipdiffendaffer.com/formtesting/translate.php this shows the result of my initial query. Each result is placed in a row. For every listing, if the user clicks "Correct" and submit, I want to write a 1 to the awaiting column in the database. If "Error" is checked, I want to write a 0. If "Delete" is checked, I want to delete that row altogether. If nothing is checked, the value remains NULL and will be available to flag later. Quote Link to comment https://forums.phpfreaks.com/topic/88781-updating-table-through-checkboxradio-and-form-submit/#findComment-454823 Share on other sites More sharing options...
diffenc Posted February 1, 2008 Author Share Posted February 1, 2008 Sorry, checking once again. Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/88781-updating-table-through-checkboxradio-and-form-submit/#findComment-455262 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.