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.
That code was mine final attempt of the form and I hope that may be there is some'one here on the forum who knows how to do it.Code:<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> <?php include("../../database/sqlconnect.php"); $query=mysql_query("SELECT * FROM leftmenulink"); while($query2=mysql_fetch_array($query)) { echo $query2['links']; echo '<input type="checkbox" name="links"> <br>'; } ?> <input type="submit" value="remove" name="remove"> </form> <?php if(isset($_POST["remove"]) && isset($_POST["links"])) { $remove=$_POST["links"]; $remove=mysql_query("DELETE FROM leftmenulink WHERE links = $remove"); if(!$remove) { echo "Nothing has removed"; } } ?>


Reply With Quote
Bookmarks