diffenc Posted February 1, 2008 Share Posted February 1, 2008 Quick overview: I have forms writing to two columns in a table and looking to mark correct/mark error the unique entries that are put in. (The forms writing to the db is complete) By fetching unique strings from a given column ("box1t" below), I want to write back either a "1" or a "0" to another column based on a reviewer's selection ("decision") through a results table as well as a text field to a third column ("reason1") for each unique entry returned. See this form: http://chipdiffendaffer.com/formtesting/translate.php $box1dist = mysql_query("SELECT DISTINCT box1t FROM formtest WHERE task_id = 1"); echo "<form id=\"form1approval\" name=\"form1approval\" method=\"post\" action=\"runapproval.php\" ><table border='1'> <tr> <th>Box one result</th> <th>Approve</th><th>Mark Wrong</th><th>Error Reason</th> </tr>"; while($row = mysql_fetch_array($box1dist)) { echo "<tr>"; echo "<td>" . $row['box1t'] . "</td>"; echo "<td>Correct: <input type=\"checkbox\" value=\"1\" name=\"decision[]\" \/></td><td>Error: <input type=\"checkbox\" value=\"0\" name=\"decision[]\" \/> </td><td>Error Reason: <input type=\"text\" name=\"reason\" \/> </td>"; echo "</tr>"; } echo "</table><input type=\"submit\" name=\"submit\" value=\"submit\" \/></form>"; ?> So after the fetch_array, I need to post back the user selected values from the checkboxes + the text input to the table and match them to the uniques. I know I need a loop to post back and probably some regular expression, but I'm 5 years removed from programming this stuff. I haven't gotten anywhere on my runapproval.php script. Quote Link to comment https://forums.phpfreaks.com/topic/88925-rephrased-question/ 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.