title: Bootstrap typeahead and forms - Object of class mysqli could not be converted to string
body: <p>I have having issues with Twitter's bootstrap type ahead. So far everything is going smoothly, however when I drop the value the user selected in the typeahead into a form and post it by the update function to a script I get the below error</p>
  
  <blockquote>
    <p>Catchable fatal error: Object of class mysqli could not be converted to string in</p>
  </blockquote>
  
  <p>The below is my php and mysql code</p>
  
  <pre><code>$race_name = print_r($_POST['race'],true);
  echo gettype($race_name);
  echo $race_name;
  $race_query= mysqli_query($dbc."
      SELECT CITY, DATE, NAME, STATE
      FROM RACE_INFO
      WHERE NAME LIKE '$race_name'")or die ('Could not find race: '.mysqli_error());
  </code></pre>
  
  <p>As you can see i have tried to force the variable to be a string. When I echo the gettype it confirms that it is a string, but I am still receiving the error.</p>