I have a search form. I would like when someone type the term, first to search trough users table and to return his name, username, e-mail etc…and next I should perform another query with the SAME search term from another table example: posts and return posts with the user name and the post.
So I have to return and display 2 sets of results. I must admit that I am totally lost, and have no idea how to proceed.
Anyone can help me with an idea how to do this with codeigniter?
Thanks in advance, Zoreli
You cannot do the two searches asycn if that what’s you’re looking to do.
The best and easiest way would be to do it like this:
This assumes the
searchmodel has the methods that search the tables. In your view, you can iterate over$usersand$viewsto reference the returned results.