Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
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.