First I would like to update the records. I created dropdown box which has values from mySQL FROM SELECT statemet it's working fine with one previously selected database entry. but what I would like to have another values for the modification wich i have in another table.
DROP DOWN FOR THE UPDATE from order table value.
echo '<div class = "MediaType" >'; //Start class Media Type
echo '<strong><label for="rate">Media Type</label></strong>';
echo '<br/><br/>' ;
$sql = "SELECT `media_type` FROM `order` where `po_number` = '".$ponumber."'";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result))
{
echo "<select class='dropdownsize' name='media_type[]' tabindex='$k'>";
echo "<option value='" . $row['media_type'] . "'>" . $row['media_type'] . "</option>";
echo '</select>';
echo '<br/>';
}
echo '</div>'; //End Class Media Type
It's give me value "ONLINE" in dropdown which I selected and Inserted during the Insert process.
DROP DOWN FOR INSERT Page from media_type table
echo '<div class = "MediaType" >'; //Start class Media Type
echo '<strong><label for="rate">Media Type</label></strong>';
echo '<br/><br/>' ;
//for loop for dropdown from user index//
for($k=1;$k<=$textboxindex;$k++)
{
$sql = "SELECT media_type FROM media_type";
$result = mysql_query($sql);
echo "<select class='dropdownsize' name='media_type[]' tabindex='$k'>";
while ($row = mysql_fetch_array($result))
{
echo "<option value='" . $row['media_type'] . "'>" . $row['media_type'] . "</option>";
}
echo '</select>';
echo '<br/>';
}
echo '</div>'; //End Class Media Type
table name = "media_type" values = "TV","ONLINE","Roller",Banner","Roll Over"
I want to have this "media_type" values in my update drop box as same as the insert dropbox so enduser can modify entry with media_type values as Insert. but when it's display 1st time then default values of dropbox should be same as previous entered data.
sorry my question is confusing. What is the best way to doing.? Any help will be appreciate. thank You