The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
So I have an assignment due at midnight (creating a crude message board with PHP/MySQL), and it's pretty much all done, all it needs it commenting. However I'm trying to implement something for extra credit. Basically, it's a function that allows moderators to edit messages. However, when I go to update the database, it doesn't update it, although mysql_query() returns a true value. Here is my code :
elseif($action == "Submit Edit")
{
$messageid = $_SESSION['editmessage'];
$body = $_POST['body'];
echo "$body and $messageid<br/>";
$modid = $_SESSION['id'];
$body = stripslashes(trim($body . " edited by $modid"));
dbconnect();
$query = "update Messages set body = '$body' where message_id = '$messsageid'";
$result = mysql_query($query);
echo "result = $result<br/>";
unset($_SESSION['editmessage']);
unset($_SESSION['edituser']);
}
You could also try calling mysql_affected_rows() after the query has been executed, to confirm that the database isn't updating the row. If it is, it's possible you've got some sort of caching issue.
Ok... when entering the code to do that, I realized that in the query, I had one too many s's in message_id. Wow. I feel really stupid. Thanks a lot for the help though duders.
Posts
Also, I'm not quite following you Seguer.