Why does %Da display as Ú when printing my CodeIgniter query?
I am trying to print my query from with my CodeIgniter 2 model method, but when the LIKE search term is David, the printed string is corrupted. My model method: function get_cust($search = 'David') { $query = 'select pp.first_name from Cust pp where'; $query .= ' pp.first_name LIKE "%' . escape_like_str($search) . '%")'; print_r(mysql_real_escape_string($query)); } The output in the browser is: select pp.first_name from Cust pp where pp.first_name LIKE 'Úvid%' How can I get it like: select pp.first_name from Cust pp where pp.first_name LIKE '%David%' Using addslashes() and mysql_real_escape_st
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.