Baseball Posted December 24, 2009 Share Posted December 24, 2009 mysql_query("UPDATE forum_topics SET `time`='".time()."', ". "lastposter='{$_SESSION['user_name']}', ". "lastposterid='{$_SESSION['user_id']}', ". "lastposttime='" .time() ."', ". "replies='replies+1'". "WHERE id='" .$tid ."'") or die(mysql_error()); why wont my replies work .. ? im add replies=replies+1 and im not getting error either Link to comment https://forums.phpfreaks.com/topic/186255-repliesreplies1-wont-work/ Share on other sites More sharing options...
ChemicalBliss Posted December 24, 2009 Share Posted December 24, 2009 i believe it should be something like: mysql_query("UPDATE forum_topics SET `time`='".time()."', ". "lastposter='{$_SESSION['user_name']}', ". "lastposterid='{$_SESSION['user_id']}', ". "lastposttime='" .time() ."', ". "replies=(forum_topics.replies+1)". "WHERE id='" .$tid ."'") or die(mysql_error()); but not sure (may need to SELECT that field and update using php first. -CB- Link to comment https://forums.phpfreaks.com/topic/186255-repliesreplies1-wont-work/#findComment-983650 Share on other sites More sharing options...
Buddski Posted December 24, 2009 Share Posted December 24, 2009 ChemicalBliss is right.. although the table isnt required.. Your original query would work if you remove the code from quotes.. mysql_query("UPDATE forum_topics SET `time`='".time()."', ". "lastposter='{$_SESSION['user_name']}', ". "lastposterid='{$_SESSION['user_id']}', ". "lastposttime='" .time() ."', ". "replies=replies+1". "WHERE id='" .$tid ."'") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/186255-repliesreplies1-wont-work/#findComment-983655 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.