Ok, so I change the url but i'm not sure where to put that case statement.. I'd like to be able to have it so i'm looking at admin.php and the delete link goes to admin.php, deletes the record and displays an updated list.
Here's my code so far..
/* Database Settings */
$db_name = "database";
$db_user = "username";
$db_pass = "password";
$db_table = "table_name";
$db_server = "localhost";
/* Connecting, selecting database */
$link = mysql_connect($db_server, $db_user, $db_pass)
or die("Could not connect");
// print "Connected successfully";
mysql_select_db($db_name) or die("Could not select database");
/* Performing SQL query */
$query = "SELECT id, title, text FROM $db_table ORDER BY id DESC LIMIT 5";
$result = mysql_query($query) or die("Query failed");
echo "Admin Section";
if ($row = mysql_fetch_array($result)) {
do {
echo "<tr><td>";
echo "<a href=\"admin.php?action=del&row=" . $row[id] . "\">[ DELETE ]</a>";
echo "</td><td>";
echo " - <a href=\"http://edit_an_entry.php\">[ EDIT ]</a> - ";
echo "</td><td>";
echo $row["title"];
echo " -";
echo "</td><td>";
echo $row["text"];
echo "</td></tr>";
} while($row = mysql_fetch_array($result));
} else {print "Sorry, no records were found!";
}