First things first, I had to update your code. It was kind of hard to read.
Secondly, I'd need more information on the table (are there any IDs available)... If you can provide that, I can show you how to make it update the names.
And just for your learning pleasure, here's the cleaned up script. P.S. You don't need to select the age column when you provide the value in the query :P
<?php
$con = mysql_connect("localhost","root","");
If (!$con)
{
die('Could not connect: ' . Mysql_error());
}
mysql_select_db("hai", $con);
?>
<form action='pp1.php' method='post'>
&l t;h2 align='center'>Member Profile</h2>
&l t;table border='1' cellpadding='3' cellspacing='2' style='background-color: #add8e6'>
&n bsp; <tr>
&n bsp; < th>First Name</th>
&n bsp; < th>Last Name</th>
&n bsp; </tr>
&n bsp;
<?PHP
$query = mysql_query("SELECT FirstName,LastName FROM persons where Age=12") or die("Cannot execute query." . mysql_error());
while ($row = mysql_fetch_assoc($query))
{
echo "
&n bsp; <tr>
&n bsp; < td><input type='text' value='{$row['FirstName']}' size='30' name='FirstName' /></td>
&n bsp; < td><input type='text' value='{$row['LastName']}' size='30' name='LastName' /></td>
&n bsp; </tr>";
}
?>
&l t;/table>
</form>
|