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

  • Home
  • SEARCH
  • 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 6011681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:17:42+00:00 2026-05-23T02:17:42+00:00

I have a search function that currently grabs data from one table, and I’d

  • 0

I have a search function that currently grabs data from one table, and I’d like to grab data from an additional table, as well.

$query = $this->db->get('tbl_customer');
$this->db->select('in_customer_id, st_company_name, in_customer_type, st_customer_account, st_customer_state_id, flg_customer_account_type, in_status, dt_added_date, st_tag');
if(trim($action['searchtxt'])!='')
    $this->db->like('st_company_name', html_entity_decode($action['searchtxt']));

The view:

   <div class="floatl"  style="width:250px;">
      <form name="frm" action="<?php echo $index_url; ?>customers/search/" method="post">
        <div class="floatl">                
          <input name="Search" type="text" class="textboxsearch" id="Search" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" value="<?php if($searchtxt!=''){ echo $searchtxt; } else{ echo 'Search'; }?>" maxlength="50" />
        </div>
            <div class="floatl searchicon">
          <input type="image"  src="<?=$admin_base_url?>images/textbox_search.gif" alt="" width="22" height="22" />
          </div>
        <br />
        <br />
        <font class="txt9">(i.e. Company, Account name)</font>
      </form>          
    </div>

The table I want to additionally search is called tbl_admin_user. Any ideas on how I can accomplish this?

  • 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-05-23T02:17:42+00:00Added an answer on May 23, 2026 at 2:17 am

    You might want to brush up on your SQL a little, especially take a look at SQL Joins.

    With that said, after re-reading your question it appears that you are attempting to search particular columns for fairly specific data within multiple tables. First you might want to look into using LIKE instead of WHERE.

    Second, depending on how you’re displaying the results you you’ll probably either write two separate queries and then loop through each of the separate results and display them. A Union or Join might be possible but also might be difficult to display the results accurately if the table structures are really different.

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

Sidebar

Related Questions

I have an an ajax request that looks like this, $('input.fakecheck').click(function(){ alert(deleteing....); $.ajax({ url:/search,
I currently have an Entity Framework model that collects data from a legacy database
I have a function that uses Pattern#compile and a Matcher to search a list
I have a function that appends a div to another div. Something like: var
Currently I have a button that with jQuery/AJAX searches for all customers from a
In my tag cloud I have urls that look like this ../search.php?query=cat&select=all ../search.php?query=the cat&select=all
I currently have a MySQL database that I am accessing using PHP. You search
if i have a search function for my site and i want the user's
I have an active directory search function: Function GetAdInfo(ByVal ADDN As String, ByVal ADCommonName
I have a problem using the Java search function in Eclipse on a particular

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.