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

#1
[eluser]sikkle[/eluser]
Hi guys,

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

When you use this :

Code:
$query = $this->db
              ->select('id, name')
              ->from($scope)
              ->like('name', $keywords)
                 ->get();

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 !

#2
[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.

#3
[eluser]sikkle[/eluser]
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-2020 MyBB Group.