title: How to see if a result from the database matches my values in the array
body: <p>Hi guys i have been trying to rap my head around this for some time now. What I'm trying to achieve is get some data from my database, store it in a variable and compare it to a value that is stored in my array. 
  Problem is it keeps returning the wrong output. From the <code>SQL</code> query below, the <code>mysql_result $total_cat</code> returns a value of <strong><code>16</code></strong>. Once this value is stored, the code is meant to output <code>echo "this value is in the array";</code> but its not working.
  Where am i going wrong?</p>
  
  <p><strong>This is my Code</strong></p>
  
  <p>Create an array to store my values in</p>
  
  <pre><code>$lunchbox = array(12,13,14,16,20,24,33,32);
  </code></pre>
  
  <p>Set up my SQL database query</p>
  
  <pre><code>$query = mysql_query("SELECT * FROM table WHERE id = '$the_persons_id'");
  </code></pre>
  
  <p>Catch my result and store it in a variable</p>
  
  <pre><code>$total_cat = mysql_result($query,0,"category_id");
  </code></pre>
  
  <p>Clean my result</p>
  
  <pre><code>$total_cat  = str_replace("|", " ", $total_cat);
  </code></pre>
  
  <p>Check if my sql result matches my any of my results stored in my array</p>
  
  <pre><code>if (in_array($total_cat, $lunchbox)) {
      echo "this value is in the array";
  }else{
      echo "this value is not in the array";
  </code></pre>