Welcome Guest, Not a member yet? Register   Sign In
How to use LIKE % keyword it dosent work for me
#1

[eluser]Unknown[/eluser]
Hello all,
i have write following code

code :

class Search extends Controller {

function search_press()
{
$keyword = $this->uri->segment(3);
$this->db->like('header', $keyword, 'after');
$data['srch'] = $this->db->get('press_releases');
$this->load->view('search/search_press', $data);
}
}

$keywords seems to get well from url but not work for me in databse query to obtain only starting with KEYWORD in HEADER field of "press_releases" table.

it shows all the records that are in press_release table.

Thank You.
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums!

Try putting this in your controller's constructor. It will allow you to see the generated query.

Code:
$this->output->enable_profiler(TRUE);
#3

[eluser]Unknown[/eluser]
Thank You for reply
It prints now query and i can check it now phpmyadmin by manualy

bye




Theme © iAndrew 2016 - Forum software by © MyBB