I'm trying to make a delete button from sql. I started a function called $del but I don't know how to complete it, in the form of a delete button echoe'd out beside the current echo statements.
$con = mysql_connect("localhost", "user", "pass");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
$sql = "INSERT INTO camps (city, map, park, day, details)
VALUES ('$_POST[city]','$_POST[map]','$_POST[park]','$_POST[day]','$_POST[details]')";
if (!mysql_query($sql, $con)) {
die('Error: ' . mysql_error());
}
$number = 0;
$del = mysql_query("DELETE FROM camps WHERE user_id= '$number'");
$result = mysql_query("SELECT * FROM camps");
while ($row = mysql_fetch_array($result)) {
echo "<a href=\"'" . $row['map'] . "\">" . $row['city'] . "</a>";
echo "<br />";
}