Welcome Guest, Not a member yet? Register   Sign In
search from database using text field and search button
#1

[eluser]skhan[/eluser]
Hi! I am newbie here.
i want to create search from database using text field and search button without ajax, javascript or jquery.
i want php using codeigniter framework,

here is my table ('inventory') and my fields are ('id', 'item', 'unitprice', 'qty')

when i search 'an' i want to view all item starts with 'an',

i do login,CRUD, mvc using codeigniter but this one is difficult for me..
someone help me please.

thanks in advance!
#2

[eluser]Nisha S.[/eluser]
Do you want to search on all the fields? Then you need to add all the fields with or where clause. Use % at the end since you need to display the results starting with an.

Code:
$searchString = 'an';//get it as parameter
$this->db->like('fieldName',$searchString  . '%');




Theme © iAndrew 2016 - Forum software by © MyBB