Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:02:48+00:00 2026-06-12T23:02:48+00:00

After I get a specific word from form. I want to get results like

  • 0

After I get a specific word from form. I want to get results like this word from multiple tables in database.

function search(){
    $search = $this->input->post('searchword');
    $this->db->select('articles.title, articles.post');
    $this->db->select('files.name, files.desc');
    $this->db->select('news.title, news.post');
    $this->db->select('projects.title, projects.desc');
    $this->db->from('articles, files, news, projects');

    // I think problem is here
    $like = array('articles.title' => $search,'articles.post' => $search,
    'files.name' => $search,'files.desc' => $search,
    'news.title' => $search,'news.post' => $search,
    'projects.title' => $search, 'projects.desc' => $search);
    $this->db->like($like);


    return $this->db->get();

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:02:49+00:00Added an answer on June 12, 2026 at 11:02 pm

    CI’s joining is crap…

    I always will create a proper sql statement with joins, and then just execute that.

    $query = $this->db->query("BUILD A PROPERLY JOINED QUERY!");
    

    If you’re not able to do it yourself… build the query in PHPMyAdmin or MySQL Workbench and make sure you get the results you’d expect.

    Also, while I’m not a fan of CI’s Active Record, have a look at this post to perhaps tune the join it’s creating -http://codeigniter.com/forums/viewthread/93198/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After using this code to get my link to show me 3 database entrys
I want to get a specific value from a resource programmatically. For example, I
After I get the Auth token from https://www.google.com/accounts/ClientLogin do I need to send 1
I have a javascript/jQuery block as a callback after $.get function: function myCallBack(data, textStatus)
This class hangs at Future.get() method after executing ExecutorService.shutdownNow() called. I don't know what
For example in some cases after POST or GET request I want to redirect
I want to dynamically collapse table column to specific width (10 px in this
I am trying to get a specific package (Launcher2) from the google git repo
I want to get some specific parts of an image so I'm cropping the
I'm not going to get specific here with code, because I don't feel like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.