title: issue with PHP PDO code won't execute
body: <p>am making comment system for my website forum and I want  to insert the new comment into the forum comment table in my DB am sure that the code being, using
  to insert the code in my table is correct but still not working</p>
  
  <pre><code> **// function to submit users replies to the topics** 
  function replayTopic($conn,$errors,$success){
      **// get the topic link from the page link**    
      $topicLink = $_GET['name'];
  
      **// check if the submit button is clicked**
      if (isset($_POST['topicReplay'])) {
          **// get the user id from the session**
          $userId = $_SESSION['id'];
          **// get the comment from the textarea** 
          $replay = $_POST['commentPost'];
          **// get the topic id** 
          $getTopicId = "SELECT topicId FROM topics WHERE topicLink = :topicLink";
  
          if ($topicStmt = $conn-&gt;prepare($getTopicId)) {
              $topicStmt-&gt;bindParam(':topicLink',$topicLink);
  
              **// execute the query above**
              if ($topicStmt-&gt;execute()) {
  
                  **// fetch the data from the query above**
                  if ($topicRow = $topicStmt-&gt;fetch()) {
                      **// apoint the topic id to the topicId var**
                      $topicId = $topicRow['topicId'];
                      **// inert the comment into the forum comment table**
                      $insertComment = "INSERT INTO 'forumcomment'                                   
                                          (comment, commentDate, commentBy, topicComment) 
                                        VALUES
                                          (:replay, NOW(), :userId, :topicId)";
  
                      if ($stmt = $conn-&gt;prepare($insertComment)) {
                          **// bind the placeholders from the insert query**
                          $stmt-&gt;bindParam(':replay', $replay);
                          $stmt-&gt;bindParam(':userId', $userId);
                          $stmt-&gt;bindParam(':topicId', $topicId);
  
                          **// for some reason the query above won't execute**
                          if ($stmt-&gt;execute()) {
                              echo "string";
                          }else{
                              echo "not working";
                          }
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>and this is the front end of the code am, using </p>
  
  <pre><code>&lt;?php echo '&lt;form action="'.replayTopic($conn,$errors,$success).'" class="mt-4" method="POST"&gt;';?&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="replays"&gt;Comment &lt;/label&gt;
          &lt;textarea name="commentPost" id="replays" cols="30" rows="6" 
          class='form-control'&gt;&lt;/textarea&gt;
      &lt;/div&gt;
  &lt;div class="row"&gt;
      &lt;div class="form-group col-4 ml-auto"&gt;
          &lt;button class="form-control btn btn-success w-100" type="submit" name="topicReplay"&gt;Replay&lt;/button&gt;
      &lt;/div&gt;
      &lt;div class="col-8 mr-auto"&gt;
  &lt;li class="form-control btn btn-link text-right" id="cancel"&gt;Cancel&lt;/li&gt;        
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I am sure that all of the variables are correct. I tried to echo all of them. 
  I go throw this 10 times till now and I couldn't find whats wrong with this code.</p>