I am trying my best to do a user interface script that with a click of a link it will remove a record from a table. This is what I have come up with so far.
[code=php]
$connection = mysql_connect($host, $user, $password) or die (“Error with the connection to server. “);
$db = mysql_select_db($database, $connection) or die (“Could not connect to Database. “);
$query = “SELECT * FROM tbllinks”;
$result = mysql_query($query) or die (“Query could not be executed. “);
echo “<table>”;
while ($row = mysql_fetch_array($result))
{
extract($row);
echo “<tr><td>” . $linkURL . “</td><td>” . $linkName . “</td><td><a href=””>remove link</td></tr>”;
}
echo”</table>”;
mysql_close();
I would like it to be to where when the user clicks on the “remove link” link, it will delete that specified record. I know the SQL for that is something along the lines of..
[code=php]
Delete From ‘tbllinks’ Where ‘linkid’ = $linkid
..but don’t know how to get it to how I want to get it.
If someone could please help me or point me in the right direction I would much appreciate it. Thank you for your time.
-Cesar