In my PHP - Codeigniter function(), I gave the following command:
function get_cust($search='David')
{
$query = 'select pp.first_name from Cust pp where';
$query .= ' pp.first_name LIKE "%'.$search.'%")';
print_r(mysql_real_escape_string($query));
}
But while i executed the output in browser:
select pp.first_name from Cust pp where pp.first_name LIKE 'Úvid%'
Is it anyway so i can get it like:
select pp.first_name from Cust pp where pp.first_name LIKE '%David%'
I have tried using addslashes()
, mysql_real_escape_string()
as well.