I am working in codeigniter php. I want to search from database when it match some or one keywords. But i don't know how to do it. When it match some keywords in database, in user panel it show some keyword related content.
Can anyone tell me how to do it ?
Here: http://goo.gl/yvwKi3
First 3 results tell you how to do it with full source code.
1) input field
2) onkeyup event
3) XMLHttpRequest
4) param "searchkey"
4) php script
5) db connection
6) query "SELECT * FROM table WHERE textfield LIKE '%".$searchkey."%'"
and the whole way back again...
You can use the Jquery "post()" method to post your search input to a php file which in turn runs a mysql query to look for the data in the database. The php file should "echo" the results back in json format. Use "json_encode()" function for this. Back in the jquery post() function, parse the json result and display it to the user.