title: getting data from mysql showing empty string
body: <p>I fetch data from mysql and convert it to JSON but receive an empty array as a result: <code>[]</code></p>
  
  <p>I want to select all data where category=given variable:</p>
  
  
  
  <pre><code>$flu = $_POST['searchCode'];
  $query = mysql_query("SELECT * From catalog_Master WHERE  category='%$flu%'");
  
  $rows = array();
  while($row = mysql_fetch_assoc($query)) {
      $rows[] = $row;
  }
  echo json_encode($rows);
  </code></pre>