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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.