Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB