title: php variable passed to mysql query
body: <p>Not sure what I am doing wrong?  Never ran into this issue before?  But this is also the first function I have written.</p>
  
  <pre><code>&lt;?php
  function category($string){
  if(preg_match("/(Slimming|Laser|Spa|Massage|Manicure|Pedicure)/i", $string)){  
  echo 'Spa';
  }
  }  // This is function.php
  
  $title = 'Spa';
  
  include 'function.php';
  $category = category($title);
  $category = mysql_real_escape_string($category);
  echo "$category&lt;br&gt;"; // I get Spa
  var_dump("$category"); //added for testing, I get string(0) ""
  </code></pre>
  
  <p>$category is then sent to a mysql insert, the value is blank in the database...</p>
  
  <p>Thanks for the help.</p>