Welcome Guest, Not a member yet? Register   Sign In
Search algorithm
#1

[eluser]Unknown[/eluser]
hi everyone

Please help me in search keyword in a field i.e

i need to search "multiple keywords" i.e(sales support)
also with that search keywords with plurals and also for singular. these all conditions together in one search.
when i search $key= 'sale',
it should display titles with sales,sale,sales support.. etc

this is the query i gave
select id,title from c_posts where title like '%$key%';

Can anyone help me with good search algorithm
its really urgent using codeigniter
#2

[eluser]John_Betong[/eluser]
 
Try something like this: (no pun intended)

Code:
$sql = "SELECT id,title FROM c_posts WHERE title LIKE ‘%'"  . $key ."'%’";
    $query = $this->db->query($sql);

    echo '<pre>';
     print_r($query->result());
    echo '</pre>';
    die;
&nbsp;
&nbsp;
&nbsp;




Theme © iAndrew 2016 - Forum software by © MyBB