hi
i am not able to update my table.plz do tell me the bug in my code.....
when update link is clicked in the first page..the table should get updated
page 1
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$x = $_GET;
$result=mysql_query("SELECT * FROM table1 where name='$x'") or die("ERROR:".mysql_error());
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$x= mysql_fetch_row($result);
print 'Name<input type="text" maxlength="19" size="53" name="name" value="'.$x[0].'" />';
print "<a href='page2.php?name=".$x[0]."'>Update</a>";
}
mysql_close($link);
page 2
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$name1 = $_GET;
mysql_query("UPDATE table1 SET name='$name' where name='$name1'") or die("ERROR:".mysql_error());
echo "thanks";
mysql_close($link);