我有一個搜索功能,當前從一個表中獲取數據,並且我想從另一個表中獲取數據。查詢來自多個表的數據
$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']));
的觀點:
<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>
我想表到另外的搜索被稱爲tbl_admin_user
。有關我如何完成此任何想法?
正確 - 我試圖從多個表中獲取特定的數據並顯示一個基於ID的數組。我實際上只是發現了這一點,這幾乎和我遇到的問題完全一樣:http://www.webmasterworld.com/php/3610400.htm。好奇,如果這個解決方案是一個很好的... – blackessej 2011-06-15 19:36:18
在該論壇上發佈的答案結合獲得更多的知識,我在我的帖子中提到的項目應該讓你順利。 – tplaner 2011-06-15 19:40:33
謝謝@evolve。很有幫助 – blackessej 2011-06-15 19:46:53