First of all, this is extremely unsafe, you should not use this code without further safety measures!
Now you will delete one row from the table Brochures where column has the value of $entrie.PHP Code:// thisfile.php
function del_entrie($entrie)
{
$query = "DELETE FROM Brochures WHERE column = '" . $entrie ."'";
$result = mysql_query($query);
if (!$result)
{
echo mysql_error();
}
}
if (isset($_GET["text"]))
{
del_entrie($_GET["text"]);
}
For example:
If the user clicks that link, he will delete the entire row where ever the column "column" includes the text "foo".HTML Code:<a href="thisfile.php?text=foo">Delete me!</a>
If you want to do something like this, you should search this forum for "SQL injection", since that will become a big problem for you if you use code like this.




Reply With Quote