views:

116

answers:

2

My delete.php is sending the selected item to the db as dead as it should, but the blog is still staying on the page that its deleted from. What am I doing wrong? this is my query: on the delete.php:

$MyBlog =  $_GET['id'];

$query = "UPDATE `Blogs` SET `status` = 'dead' WHERE `id` = '".$MyBlog."'";

Like I said, this is marking id dead on the db as it should, but not deleting the actual blog off of the page, is this because I don't have: AND `status` != 'dead' on the page it's getting sent from?

A: 

how are you selecting the entries on the blog page.

SELECT * FROM blog WHERE status NOT dead

Maybe that would work?

Kieran
dead is a string.
Franz
So therefore this should be `SELECT * FROM blog WHERE status!='dead'`
Franz
@Franz: so you are saying to put that on the page that is sending to the delete.php?
Ralph The Mouf
@ralph. Nar this statement will get the blogs that have a status that is not marked as dead. From what you have written it sounds as though your statement to mark the blog records is working. The problem is in selecting the records on the display blog page. The where statement will stop the 'dead' records being selected.
Kieran
+3  A: 

Fine. I'll just post the correct answer then (note the typo in Kieran's):

SELECT * FROM blog WHERE status!='dead'

That's what your SELECT query should look like.

Franz