Jump to content

updating a table


loony383

Recommended Posts

Hi i want my code to add 1 to postcount of the user when they make a post on my forum but i dont know how to do this, here is my code can someone please tell me how to do the update thing to add 1 to the users postcount

 

      $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,forumid) values('$name','$subject','$yourpost','$displaytime','$thedate','$name','$forumid')";

      mysql_query($insertpost) or die("Could not insert post"); //insert post
      
      mysql_query(*UPDATE users set 'postcound'=$postcount [$postcount=1])

      print "Message posted, go back to <A href='index.php?forumid=$forumid'>Forum</a>.";

   }


 

thats the part of my code where i want it to update the postcount

Link to comment
https://forums.phpfreaks.com/topic/63991-updating-a-table/
Share on other sites

Parse error: syntax error, unexpected T_STRING in /home2/airserve/public_html/airboard/post.php on line 82

 

didn't work, i thought it had to have the math stuff like operators in the line but i don't understand about doing stuff within a bit of code like just putting a operator

Link to comment
https://forums.phpfreaks.com/topic/63991-updating-a-table/#findComment-318983
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.