I have run into another peoblem with my news script. This time i am not quite shure where my problem lies (SQL statements, or actual php code). What i am trying to do is delete news entries from my mysql database. I have one script that does all of my admin work for me (Adding, deleting, and editing posts). I pass variables from one part of the script to the other like so:
admin.phtml?page=delete_post&id=6
This should prompot my script to delete all the info matching in id 6. But it does not instead i get sent back to my main admin page with the above url in my address bar. I have no idea what is going on. I have enclosed the delete post code below. As always thank you for your help!
//delete entry
elseif ($page = deletepost)
{
if (!IsSet($Stage))
{
//Open connection and select database
include("/web/sites/292/burwell/www.burwell.f2s.com/db_functions.inc");
mysql_connect($hostname, $user, $password) or die("There is something worng with the connect info or the server " . mysql_error());
mysql_select_db("burwell");
//Delete info
$delete_query = "DELETE id, date, title, content FROM articles WHERE id = &id";
$delete_result = mysql_query($delete_query);
if($delete_result == 0)
{
Print("There was a problem deleting that entry");
}
else
{
Print("News entry deleted sucessfully\n");
Print("<a href=\"$PHP_SELF?page=edit\">News Edit</a>");
};
};
}