Try this for the inserting of the field.
Code:
<?php
include ('dbconn.cfg');// database configuration file
$connection = @mysql_connect("localhost", "root", "") or die("Cannot connect to server!");
if (isset($_SESSION['gmembername']))
{
$tbl_name = "member";
$sql = "SELECT name,telephone,address FROM $tbl_name";
$result = @mysql_query($sql, $connection) or die("Cannot execute query.");
$numrow = mysql_num_rows($result);
if ($numrow != 0)
{
// fetch each record in result set
for ($counter == 0; $row = mysql_fetch_row($result); $counter++)
{
// build table to display result
print ("<h2><center>Member Profile</center></h2>");
print ("<table border = '1' cellpadding = '3' cellspacing = '2' style = 'background-color: #ADD8E6'>");
print ("<tr>");
print ("<th>Full Name</th>");
print ("<th>Telephone</th>");
print ("<th>Address</th>");
print ("</tr>");
print ("<tr>");
foreach ($row as $key => $value)
print ("<td><input type ='text' value='$value' size = '30'></td>");
print ("</tr>");
print ("</table>");
}
}
}
?>
As for the editing of only certain fields, you can append "readonly" to the field that you don't want editable. This would look something like the following:
Code:
<input type="text" name="blah" value="blah blah" readonly>
Hope this helps.
Bookmarks