title: SQL Selection not outputting data
body: <p>Starting off, I'm kind of stumbling in the dark here with PHP/SQL, and don't really know how to bugtest that well, so forgive my vagueness about the exact nature of the problem. Moving on.</p>
  
  <p>I have some code which grabs category ids, names, and descriptions from an SQL table, and saves the result to a variable. This is done through statement preparing to avoid an possibility of SQL injection. This value is then fed into some PHP which checks if the query had any response, and if so prints that into a table.</p>
  
  <pre><code>&lt;?php
  
  //create_cat.php
  include_once (__DIR__ . '/../includes/db_connect.php');
  include_once (__DIR__ . '/../includes/functions.php');
  
  include_once (__DIR__ . '/header.php');
  ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(-1);
  $stmt = "SELECT
              cat_id,
              cat_name,
              cat_description
          FROM
              categories";
  if (login_check($mysqli) == true) {
      if(!$result = $mysqli-&gt;query($stmt)){
          echo 'The categories could not be displayed, please try again later.';
      } else {
          if ($result-&gt;num_rows === 0) {
              echo 'No categories defined yet.';
          } else {
              //prepare the table
              echo '&lt;table border="1"&gt;
                &lt;tr&gt;
                  &lt;th&gt;Category&lt;/th&gt;
                  &lt;th&gt;Last topic&lt;/th&gt;
                &lt;/tr&gt;';
  
              while ($row = $result-&gt;fetch_assoc()) {
                  echo '&lt;tr&gt;';
                  echo '&lt;td class="leftpart"&gt;';
                  echo '&lt;h3&gt;&lt;a href="category.php?id"&gt;' . $row['cat_name'] . '&lt;/a&gt;&lt;/h3&gt;' . $row['cat_description'];
                  echo '&lt;/td&gt;';
                  echo '&lt;td class="rightpart"&gt;';
                  echo '&lt;a href="topic.php?id="&gt;Topic subject&lt;/a&gt; at 10-10';
                  echo '&lt;/td&gt;';
                  echo '&lt;/tr&gt;';
              }
          }
      }
  } else {
      echo &lt;&lt;&lt;error
      &lt;p&gt;
      &lt;span class="error"&gt;You are not authorized to access this page.&lt;/span&gt; Please &lt;a href="../index.php"&gt;login&lt;/a&gt;.
      &lt;/p&gt;
  error;
  }
  include_once (__DIR__ . '/footer.php');
  ?&gt;
  </code></pre>
  
  <p>However, the table SQL table definitely has values, but the PHP is only outputting: "The categories could not be displayed, please try again later."</p>