i'd try to update using combo box, but it will copy previous choice. Eg.
first choice : BC
CHANGE to : ABC
the form is display ABCBC, while i just want ABC to be displayed.
below the code:
<title>Edit News</title>
<?php
include("config.php");
if ( isset ($_POST['submit']))
{
$title = $_POST['title'];
$text1 = $_POST['text1'];
$text2 = $_POST['text2'];
$text3 = $_POST['text3'];
$text4 = $_POST['text4'];
$newsid = $_POST['newsid'];
$result = mysql_query("UPDATE news3 SET title='$title', text1='$text1', text2='$text2'
, text3='$text3', text4='$text4'
WHERE newsid='$newsid' ",$connect);
echo "<b>Thank you! News UPDATED Successfully!<br>You'll be redirected to Home Page after (4) Seconds";
echo "<meta http-equiv=Refresh content=4;url=index.php>";
}
elseif( isset ($GET['newsid']))
{
$newsid = $GET['newsid'];
$result = mysql_query("SELECT * FROM news3 WHERE newsid='$newsid' ",$connect);
while($myrow = mysql_fetch_assoc($result))
{
$title = $myrow["title"];
$text1 = $myrow["text1"];
$text2= $myrow["text2"];
$text3 = $myrow["text3"];
$text4= $myrow["text4"];
?>
<br>
<h3>::Edit News</h3>
<form method="post" action="edit_news.php">
<p>
<input type="hidden" name="newsid" value="<? echo $myrow['newsid']?>">
Title:
<input name="title" size="40" maxlength="255" value="<? echo $title; ?>">
<br>
Text1:
<input name="text1" size="40" maxlength="255" value="<? echo $text1; ?>">
<br>
Text2:
<input name="text2" size="40" maxlength="255" value="<? echo $text2; ?>">
<br>
Text3:
<input name="text3" size="40" maxlength="255" value="<? echo $text3; ?>">
<br>
Text4:
<select name="text4">
<option value="abc<? echo $text4; >">abc</option> <option value="xyz<? echo $text4; ?>">xyz</option> //PROBLEM IS HERE when changing process
</select>
<br>
<input type="submit" name="submit" value="Update News">
</p>
<p>
</p>
<?
}//end of while loop
}//end else
?>
</p>
</form>