Welcome Guest, Not a member yet? Register   Sign In
BUG/TYPO CI Version 3.1.8
#1

I just updated to CodeIgniter 3.1.8 and directly stumbled on a `typo` within the DB_query_builder.

If you use the following like, you will encounter a error:

PHP Code:
$this->db->like('field''value''BEFORE'); 


This will result in a Database Error like:
syntax error '%'value' ESCAPE '!' ...

The % is placed before the quotes.


Fix:
Edit the DB_query_builder.php file on line 973 from:
PHP Code:
case 'before':                    
$v "%'{$v}'";                
break; 

to:
PHP Code:
case 'before':                    
$v "'%{$v}'";                
break; 


Didn't saw a thread of this yet, in case i missed i'm sorry  Angel
Reply
#2

(04-26-2018, 05:50 AM)nalletje Wrote: I just updated to CodeIgniter 3.1.8 and directly stumbled on a `typo` within the DB_query_builder.

If you use the following like, you will encounter a error:

PHP Code:
$this->db->like('field''value''BEFORE'); 


This will result in a Database Error like:
syntax error '%'value' ESCAPE '!' ...

The % is placed before the quotes.


Fix:
Edit the DB_query_builder.php file on line 973 from:
PHP Code:
case 'before'
$v "%'{$v}'"
break; 

to:
PHP Code:
case 'before'
$v "'%{$v}'"
break; 


Didn't saw a thread of this yet, in case i missed i'm sorry  Angel

On github: https://github.com/bcit-ci/CodeIgniter/issues/5462
Reply




Theme © iAndrew 2016 - Forum software by © MyBB