Welcome Guest, Not a member yet? Register   Sign In
Ajax autocomplete not case insensitive
#3

[eluser]zulubanslee[/eluser]
Well I decided to try a different tack. I decided to go with writing my own mysql statments, but now my bound parameters aren't working. Here is my controller now.
Code:
$q=$_POST["city_string"];
  $a = '';
  $sql= "SELECT DISTINCT city, state_name
      FROM zip_code
      WHERE lower(city) LIKE ?%";

  
  $city_state_result = $this->db->query($sql, array('city'=>$q));

This is the error message I got.
Code:
<p>Error Number: 1064</p><p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%' at line 3</p><p>SELECT DISTINCT city, state_name
      FROM zip_code
      WHERE lower(city) LIKE 'x'%



Messages In This Thread
Ajax autocomplete not case insensitive - by El Forum - 05-20-2012, 05:07 PM
Ajax autocomplete not case insensitive - by El Forum - 05-20-2012, 05:16 PM
Ajax autocomplete not case insensitive - by El Forum - 05-20-2012, 06:35 PM
Ajax autocomplete not case insensitive - by El Forum - 05-20-2012, 07:12 PM
Ajax autocomplete not case insensitive - by El Forum - 05-20-2012, 07:27 PM
Ajax autocomplete not case insensitive - by El Forum - 05-20-2012, 08:12 PM
Ajax autocomplete not case insensitive - by El Forum - 05-20-2012, 08:25 PM
Ajax autocomplete not case insensitive - by El Forum - 05-21-2012, 12:24 AM
Ajax autocomplete not case insensitive - by El Forum - 05-21-2012, 09:57 AM
Ajax autocomplete not case insensitive - by El Forum - 05-21-2012, 11:08 AM
Ajax autocomplete not case insensitive - by El Forum - 05-23-2012, 03:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB