title: PHP not fetching data from MySQL database
body: <p>I'm making a comment box, in which </p>
  
  <ul>
  <li>Comment box will be under the post</li>
  <li>Every comment box has the same id as the post has </li>
  <li>That's why i preffered to do a <code>while</code> loop </li>
  </ul>
  
  <p>But, the problem is </p>
  
  <ul>
  <li>As i'm using a <code>fetch_assoc()</code> method, some comment tables will be empty so 
  i've made a if else code for them</li>
  </ul>
  
  <p>Here is my if else code : </p>
  
  <pre><code>$select_comment_table = "SELECT * FROM feed_comment_" . $row['id'] . "ORDER BY id";
  $result_query_select_comment_table = $dbc-&gt;query($select_comment_table);
  if(!$result_query_select_comment_table) {
      $result_select_comment_table = array("full_name" =&gt; "", "comment"=&gt; "No comments yet.");
  
  }
  else {
      $result_select_comment_table = $result_query_select_comment_table-&gt;fetch_assoc();
  }
  </code></pre>
  
  <p>If other code is need : </p>
  
  <pre><code>echo '&lt;div id="feed_comment_box_' . $row['id'] . '"' . 'class="feed_comment_box_cl"&gt;&lt;div id="add_comment_id" class="add_comment_cl"&gt;
  &lt;form class="comment_form" method="post" action="' .$_SERVER['PHP_SELF']  . '"&gt;
  &lt;input name="comment_full_name" type="text" class="input_comment_full_name"&gt;  &lt;/input&gt; 
  &lt;textarea name="input_comment_text" type="text" class="input_comment_text" &gt;&lt;/textarea&gt;&lt;input name="comment_submit" type="submit"&gt;&lt;/input&gt; &lt;br&gt;
   &lt;/form&gt;
  &lt;/div&gt;&lt;br&gt;
  &lt;div id="comment_box_id" class="comment_box_cl"&gt;
  &lt;table tabindex="0" class="comment_box"&gt; 
  &lt;tr&gt; &lt;td class="comment_full_name"&gt;' . $result_select_comment_table["full_name"] . '&lt;/td&gt;&lt;/tr&gt;&lt;br&gt;' . 
  '&lt;tr&gt; &lt;td class="comment_full_name"&gt;' . $result_select_comment_table["comment"] . '&lt;/td&gt;&lt;/tr&gt;&lt;br&gt;'
  . '&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;';
  echo '&lt;/div&gt;';
  </code></pre>
  
  <p>Problem : As you see the <code>if else</code> code, the php should echo <code>no comments yet</code> when there is no comment. But, even after inserting the comment(i tried manually insert in database) it is showing <code>no comments yet</code> whereas it should show the comments <br><br>
  Note: I am using a while loop that's why the comment div is coming under every post.</p>