title: Search mysqli table with form and display results
body: <p>I'm searching a table with a form where the result could be from any of the 3 choices (cata, catb or catc) and then display the results, however my error warning keeps popping up and can't display the result?</p>
  
  <p>I'm stuck...</p>
  
  <pre><code>&lt;?php
  
  include("config.php");
  
  $cata = $_POST['cata'];
  $catb = $_POST['catb'];
  $catc = $_POST['catc'];
  
  $query = "SELECT * FROM photos WHERE cata=? OR catb=? OR catc=?";
  $conn = $db-&gt;prepare($query);
  $conn-&gt;bind_param("sss", $cata, $catb, $catc);
  
      if ($conn-&gt;execute()) {
      $result_db = $db-&gt;query($query) or die('Error perform query!');
      }
  ?&gt;
  &lt;table border="1"&gt;
  &lt;tr&gt;
      &lt;th&gt;cata&lt;/th&gt;
      &lt;th&gt;catb&lt;/th&gt;
      &lt;th&gt;catc&lt;/th&gt;
  &lt;/tr&gt;
  &lt;?php
  while ($r = $result_db-&gt;fetch_object()) {
  
      echo '&lt;tr&gt;';
      echo '&lt;td&gt;' . $r-&gt;cata . '&lt;/td&gt;';
      echo '&lt;td&gt;' . $r-&gt;catb . '&lt;/td&gt;';
      echo '&lt;td&gt;' . $r-&gt;catc . '&lt;/td&gt;';
      echo '&lt;/tr&gt;';
  }
  $db-&gt;close();
  ?&gt; 
  </code></pre>