• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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  . '%');


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.