Hi, i have this form that i use to update data on a mysql db. The problem i'm having is the form only lets me update record 1 and no others and i've been trying to find a way to fix it but as yet have been unsuccesful. does anyone know what i can do so that if i wanted to update eg record number 5 i could? below is the code, many thanks in advance...i'm still very new at this
<html><head><title>DVD file</title></head>
<body>
<?
$dvd_id='';
$dvd_id=print_r("$dvd_id");
$db = mysql_connect("localhost","username");
$link = mysql_select_db("test",$db);
$result=mysql_query(" SELECT * FROM dvds WHERE dvd_id='$dvd_id'");
$num=mysql_num_rows($result);
$i=0;
while ($i < $num) {
$dvd_name=mysql_result($result,$i,"dvd_name");
$dvd_price=mysql_result($result,$i,"dvd_price");
$genre=mysql_result($result,$i,"genre");
$release_date=mysql_result($result,$i,"release_date");
$information=mysql_result($result,$i,"information");
?>
<TABLE cellSpacing=0 cellPadding=0 width=400 border=0>
<form action="ud.php" method="post">
<TBODY>
<TR vAlign=top>
</TR></TBODY></TABLE>
<table width="44%" height="222" border=0 align=center>
<tbody>
<tr>
<td align=right>DVD ID </td>
<td><input type="text" name="dvd_id" value="<? echo "$dvd_id"?>"></td> </tr>
<tr>
<td align=right>DVD Name </td>
<td><input type="text" name="dvd_name" value="<? echo "$dvd_name"?>"></td> </tr>
<tr> <td align=right>DVD Price</td>
<td><input type="text" name="dvd_price" value="<? echo"$dvd_price" ?>"></td>
</tr>
<tr>
<td align=right>Release Date</td>
<td><input type="text" name="release_date" value="<? echo"$release_date" ?>"></td>
</tr>
<tr> <td align=right>Genre</td>
<td><input type="text" name="genre" value="<? echo"$genre" ?>"></td>
</tr>
<tr>
<td align=right>Information </td>
<td><input type="text" name="information" value="<? echo"$information" ?>"></textarea></td></tr>
<tr><td align="center"><input type="Submit" name="submit" value="Update" /></td></tr>
</form>
</table>
<?
++$i;
}
?>
</body>
</html>