+2  A: 

Just type in your application:

echo $query = "UPDATE ProfileComments SET status = 'dead' WHERE id = '".$prof->id."' LIMIT 1";

That will ouput the query as a string. If you can see the error immediatly, great. If not try to paste it into phpMyAdmin. This should really help you debug your MySQL!

Hope it helps!

Frankie
+1 for this simple and effective teqnique. That is what I use whenever I get stuck with query.
Majid
+5  A: 

Hi Ralph,

The way I see it, I think it's overkill to make a new object when you're just using the id to update your database :)

I would do it like this:

$id = $_GET['id'];
mysql_query("UPDATE ProfileComments SET status = 'dead' WHERE id = '$id' LIMIT 1") or die(mysql_error());

See if that should do the trick!

bomortensen
Escaping. Escaping. Escaping.
erenon
sorry ;) I'm new on stackoverflow
bomortensen
That has nothing to do with being new or not. Pasting sample code that's vulnerable to SQL injection attacks doesn't help at all in my eyes.
Franz
@Franz, was my original code more on the right track? I really think it's an id problem, not getting any errors, echo the query and it looks right, just not getting rid of comment or marking it dead in db
Ralph The Mouf
Thought by "escaping" he meant "format your code before posting!" But you're right about escaping (thanks SleighBoy). There's no need to be rude though - wasn't really doing it by purpose.
bomortensen
A: 

This will escape data and cast the id as an integer, which it should be in this case.

mysql_query("UPDATE ProfileComments SET status = 'dead' WHERE id = '". mysql_real_escape_string((int)$prof->id) . "' LIMIT 1");
SleighBoy