Hi,
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:
<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>
This drop down is for each row of the status column.
When The user clicks submit by choosing some status value . I receive it in teh same page using post.
}elseif( isset($POST['main_select'])){
$lcSelectedValue = $POST['main_select'] ;
echo $lcSelectedValue;
But when I use update I need to use something like this
"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