I am new to this site . I am looking for some help in updating my database from the value selected by user.
Heres my page I have a table with rows of ID and its status. Status is a drop down menu with 4 possible options. The default displayed is the value from database. When the user picks a value form drop down menu say "completed" I want this value to be updated fro that particular id to database.
Heres my script to create drop down:
Expand|Select|Wrap|Line Numbers
- <td WIDTH=200 HEIGHT =40 align="center" rowspan="2">STATUS<form id="main_form" name="main_form" method="post" action="userZFN.php"></td>
- <option value="HOLD" <?php if($row['STATUS']=="HOLD") { echo "selected"; }?>>HOLD</option>
- <option value="ASSIGNED" <?php if($row['STATUS']=="ASSIGNED") { echo "selected"; }?>>ASSIGNED</option>
- <option value="PROGRESS" <?php if($row['STATUS']=="PROGRESS") { echo "selected"; }?>>PROGRESS</option>
- <option value="COMPLETE" <?php if($row['STATUS']=="COMPLETE") { echo "selected"; }?>>COMPLETE</option>
- </select>
- <input type="submit" id="main_submit" name="main_submit" value="submit" />
- </form>
When The user clicks submit by choosing some status value . I receive it in the same page using post.
Expand|Select|Wrap|Line Numbers
- }elseif( isset($_POST['main_select'])){
- $lcSelectedValue = $_POST['main_select'] ;
- echo $lcSelectedValue;
"Update TABLE set COLUMN = 'progress' where ID = $id";
But How DO I remember the ID???Can I pass the ID through Post/select too???
Thanks for the help