Hi there, I currently have a script that allows you to insert a record to the database, and then there is a page that displays all the records in an html table.
Now, I am wondering how to add a link "edit" next to each row, so that when clicked, the user will be able to edit that record in the database?
Any help would be greatly appreciated.
Thanks a ton!
Now, I am wondering how to add a link "edit" next to each row, so that when clicked, the user will be able to edit that record in the database?
Any help would be greatly appreciated.
Thanks a ton!
PHP:
<?
$DBhost = "xxxxxx";
$DBuser = "xxxxxx";
$DBpass = "xxxxxx";
$DBName = "xxxxxx";
$table = "2007";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$result = mysql_query("SELECT * FROM $table ORDER BY name ASC");
echo "<table border='0' p class ='style15' align='center' cellpadding='5'>
<tr>
<th>#</th>
<th>Name</th>
<th>Speech</th>
</tr>";
//set counter variable
$counter = 1;
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $counter . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['speech'] . "</td>";
echo "</tr>";
$counter++; //increment counter by 1 on every pass
}
echo "</table>";
//mysql_close($con);
?>






