codeigniter - How to set wildcard option in CI's ->like() -


I need to format my SQL with CIL like this,

  SELECT * FROM (`` name '%' as '% spinner% 60%' order 'name' acc   

Here is my DB query

 $ Code-> $ search = str_replace ("", "%", $ search); $ this- & gt; db- & gt; ('item'); such as $ -This-> (db-> 'Name', $ search); $ -by-> db-> order-by ("name", "esk");   

But I get it in this form Is,

  SELECT * FROM (`items`) where '% spinner \% 60%' order * like 'name' Ac slash (\) *  

Note: This black slash has been added by CI.

thanks

State:

Note: All values ​​have this function automatically escaped.

Actually , You have a raw "%" to -> gt; such () . He said, where you do not have complete control over the wildcard; It stops:

  $ this-> Db- & gt; Such as (['name' = & gt; spinner ',' name '=> 60'])   

Something will be generated:

  Where '% spinner%' is the name and name '% 60%'    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -