title: sql select by first letter not working
body: <p>I have a search function on a site that I'm trying to get to return all artists in a database by the first letter. Here's the code I have:</p>
  
  <pre><code>$connect = mysqli_connect($host_name, $user_name, $password, $database);
  
  $arr = array();
  $keywords = $connect-&gt;real_escape_string($_POST["keywords"]);
  $sql = "SELECT * FROM `karaoke` WHERE `artist` LIKE '" . $keywords . "%'";
  $result = $connect-&gt;query($sql) or die($mysqli-&gt;error);
  if ($result-&gt;num_rows &gt; 0) {
      while ($obj = $result-&gt;fetch_object()) {
          $arr[] = array("artist" =&gt; $obj-&gt;artist, "song" =&gt; $obj-&gt;song);
      }
  }
  echo json_encode($arr);
  </code></pre>
  
  <p>This search works fine if the keyword is 2 or more letters, but when I try and search by just one letter, I get no result. I've tried logging into the phpMyAdmin console and doing the search there and it works fine. Any ideas why it would not return the results to my search-alpha.php?</p>