title: mysql data value increase without reason
body: <p>I write this code for my telegram bot to check how many post each user post in group</p>
  
  <pre><code>$trimmedID = trim($chatId,"-");
  $chat_run = mysql_query("SELECT user_id FROM `$trimmedID`");
  if(mysql_num_rows($chat_run) &gt; 1) {
      $query_post = "SELECT `post` FROM `$trimmedID` WHERE `user_id`='$chatMID'";
      $query_post_run = mysql_query($query_post);
      if(mysql_num_rows($query_post_run) == 0)
      {
          $query="INSERT INTO `$trimmedID` VALUES('1','$chatMID','$firstname','$lastname','$username')";
          mysql_query($query);
      }else{
          $post = mysql_fetch_assoc($query_post_run);
          $count = $post['post']+1;
          $query="UPDATE `$trimmedID` SET `post`='$count' WHERE `user_id`='$chatMID'";
          mysql_query($query);
      }
  }else{
      $create_TB = "CREATE TABLE `$trimmedID` (
      post int (100) NOT NULL,
      user_id int (20) NOT NULL PRIMARY KEY,
      firstname varchar (100) NOT NULL,
      lastname varchar (100) NOT NULL,
      username varchar (100) NOT NULL
      )";
      mysql_query($create_TB);
      $query="INSERT INTO `$trimmedID` VALUES('1','$chatMID','$firstname','$lastname','$username')";
      mysql_query($query);
  }
  </code></pre>
  
  <p>first it check table exist or not
  then check for the user existance
  finally if user exist increase its number of post value with UPDATE in mysql</p>
  
  <p>post value for some users increase by itself without clear reason.
  how can I solve this problem?</p>