I'm trying to create a form so that the user can click on the checkbox to remove the selected link from the sql database, however what I ever try to do it just doesn't seem to work and I guess I'm in the wrong position of get it correctly to work.
The table leftmenulink must have the primary key (probably column named `id`).
Now you should pass that id column to html controls and then read 'em from the post to delete rows in the DB by those keys.
In general, it may look like this (I haven't checked it so it may not work as is, just an idea here):
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
$query=mysql_query("SELECT * FROM leftmenulink");
echo '<input type="checkbox" name="links" value="'. $query2['id'] .'"> <br>';
<input type="submit" value="remove" name="remove">
if(isset($_POST["remove"]) && isset($_POST["links"]))
$idsStr= implode( ",", $_POST["links"] );
$remove=mysql_query("DELETE FROM leftmenulink WHERE id IN ( $idsStr )");
echo "Nothing has removed";