Welcome Guest, Not a member yet? Register   Sign In
How i can write search function in CI ?
#1

[eluser]aamiraziz[/eluser]
Respected Developers,

i' m working on Job Portal. i don't know how can i write search function to find jobs in database.

i need to retrieve records using keyword matching (job title), not the exact title of job.
how can i write the function ??

is there any sample search function ?? please provide it to me

thank you for support.
#2

[eluser]slowgary[/eluser]
Your job listings should have a relational table containing keywords, so:
Code:
jobs table
=====================
job_id
job_title
job_employer
job_salary


keywords table
=====================
job_id
keyword

Then you could use something like php's explode() function to create an array from the user's search string. Then just query for keywords that match any of the words. You may also want to look into something like mysql's SOUNDEX() for fuzzy matching, it may help you find matches even when users spell the word wrong.

Good luck.




Theme © iAndrew 2016 - Forum software by © MyBB