I cant update my data i know theres something wrong in my code...pls help me guys i need this code ASAP... :(
<?php
$con = mysql_connect("localhost","root","");
$sql = mysql_select_db("luweegee",$con);
?>
<html>
<head><link rel='stylesheet' type='text/css' href='Style.css'/></head>
<body>
<table border=0 align='center' width=900 cellpadding=20 cellspacing=0>
<tr><td class='title' colspan=2><h1>Update Record</h1></td></tr>
<tr>
<td class='borderBaba' colspan=2></td>
</tr>
<tr>
<td class='form' valign='top'>
<ul>
<a class='navigation' href='View.php'><li>View Record</li></a>
<a class='navigation' href='Add.php'><li>Add Record</li></a>
<a class='navigation' href='Edit.php'><li>Edit Record</li></a>
<a class='navigation' href='Delete.php'><li>Delete Record</li></a>
</u>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
<td class='Addstyles' valign='top'>
<table class='Addstyle' border=0 width=550 cellpadding=7 cellspacing=0>
<?php
echo"
<tr>
<td><center>Name</center></td>
<td><center>Age</center></td>
<td><center>Sex</center></td>
<td><center>Mobile</center></td>
<td><center>Action</center></td>
</tr>
<form method='post' action='Edit.php'>";
$sel = mysql_query("SELECT * FROM resume");
while($data=mysql_fetch_array($sel))
{
echo "<tr>
<td><center>$data[name]</center></td>
<td><center>$data[age]</center></td>
<td><center>$data[sex]</center></td>
<td><center>$data[mobile]</center></td>
<td><center><input type='submit' value='Update' name='updateButt$data[id]'></center></td>
</tr>";
}
echo "</form>";
for($x=0;$x<=100;$x++)
{
if($_POST[updateButt.$x])
{
$select = mysql_query("SELECT * FROM resume WHERE id=$x");
while($data=mysql_fetch_array($select))
{
echo "
<form name='myform' method='post' action='Edit.php'>
<table border=0 cellspacing=0 align='center' class='Addstyle'>
<tr><td align='right' class='viewTable5' colspan=2><div class='textfile'>Editing: <span class='underline'>$data[name]</span></div></td></tr>
<tr><td>Name: </td><td><input type='text' size=20 name='name'/></td></tr>
<tr><td>Age: </td><td><input type='text' size=20 name='age'/></td></tr>
<tr><td>Sex: </td><td><input type='text' size=20 name='sex'/></td></tr>
<tr><td>Mobile: </td><td><input type='text' size=20 name='mobile'/></td></tr>
<tr><td colspan=2><input type='submit' value='Submit' name='submitEditForm'/></td></tr>
</form>
";
}
}
}
if($_POST['submitEditForm'])
{
$update = mysql_query("UPDATE resume SET name='".$_POST["name".$id]."', age='".$_POST["age".$id]."', sex='".$_POST["sex".$id]."', mobile='".$_POST["mobile".$id]."' WHERE id='".$id."'");
}
?>
</table>
<tr>
<td class='borderBaba' colspan=2 align='center'>
<br>Copyright 2011 © All Rights Reserved<br><br>
</tr>
</td>
</table>
</body>
</html>