The reason why is because when you first submit the form you send two specific POST vars along with it, edit_choices (containing the ID) and edit_choice, which you used to specify the action.
However, on the edit choice page you didn't resend the edit_choice or edit_choices when you resubmitted the form, therefor the following condition failed:
PHP Code:
elseif(isset($_POST['edit_choice'])){
So, what I did was resend edit_choice as a hidden var and changed edit_choices_qID to edit_choices - the second change fixed the following assignment:
PHP Code:
$edit_choice_qID = $_POST['edit_choices'];
You've also got similar problems with the edit questions part of the script. Try this fix:
Replace the following line:
PHP Code:
echo "<input type=\"hidden\" value=\"".$edit_qID."\" name=\"selected_edit_q\">";
with this line:
PHP Code:
echo "<input type=\"hidden\" value=\"".$edit_qID."\" name=\"selected_edit_question\">";
and then replace this line:
PHP Code:
$edit_ID = @$_POST['selected_edit_q'];
with this line:
PHP Code:
$edit_ID = $edit_qID;
In reality that last replacement isn't needed, instead you should replace all occurences of $edit_ID with $edit_qID. However, either way will work.