So more newb insanity.
Let's say I have a page that is already getting DB info from a previous page. Within this page - let's call it 'mental.php?sub_id=28' - I need to use a select form to update the name field (from within the same DB as I get the id).
This is what I have near the top with echos so I can see what's going on:
if ( (isset($_GET['sub_id']) && is_numeric($_GET['sub_id'])) ) {
$sub_id = ($_GET['sub_id']);
echo '<p>GET/sub_id is set to:';
echo $sub_id;
} elseif ( (isset($_POST['sub_id'])) && (is_numeric($_POST['sub_id'])) ) { // Form submission.
$sub_id = ($_POST['sub_id']);
echo '<p>POST/sub_id is set to:';
echo $sub_id;
} else {
echo '<p class="error">No get set/No post set.</p>';
}
So - this allows me to get the id from the previous page so I can show info for that record based on that sub_id. Then at the bottom I need to offer a dropdown that updates the DB for that particular record and return to the same page.
Do I need another isset further down the page? I'm not sure I understand the nature of a get/post within something that is already gotten. What would be the form action that would get me back to 'mental.php?sub_id?=28' with the changes reflected based on the submit from the dropdown? Ah, learning PHP, what fun to spend hours making a dropdown work.
Thanks for the help.