• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mysql SELECT _

Hi guys,

I know it's more a mysql question but maybe someone already see this before.

When you use this :

$query = $this->db
              ->select('id, name')
              ->like('name', $keywords)

If the user enter the sign _ (underscore), the system seem to take this for *.

I think i will have no choice than build a small patch, but maybe someone got another idea about this ?

Thanks !

[eluser]Pascal Kriete[/eluser]
The underscore is a wildcard character for the like clause (matches exactly one character). You need to escape it with a backslash.

Is it me or that would make sense to work a small patch for the like clause ?

i am maybe wrong indeed because being a wildcard character..

thanks inparo AGAIN Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.