Hi this is my delete.php
<?php
$con = mysql_connect("localhost","matanc_cmd","123123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("matanc_cms", $con);
// check if the form was submitted
// get the ID (cast it to integer if it is supposed to be integer)
$id = (int) $_GET['id'];
mysql_query("DELETE FROM content WHERE id='$id'");
mysql_close($con);
?>
I want to make this to function so thet when i want to delete,
a page from sql i won't have to go to another page.
i try to made something but isn't working
the function:
function deletePage()
{
$id = (int) $_GET['id'];
mysql_query("DELETE FROM content WHERE id='$id'");
mysql_close($con);
}
The link to delete:
<A HREF=" ".deletePage()."= <? echo $rows['id']; ?>">Delete</A>