Little brother I need to do a keyword search, three fields in three tables to search, if the younger brother I search for a keyword, where two of the tables have data, I have to how to output
Source: Internet
Author: User
I need to do a keyword search, search in three fields in three tables, if I search for a keyword, where two tables have data, how do I output
I need to do a keyword search, search in three fields in three tables, if I search for a keyword, where two tables have data, how do I output
For example, three fields are: University name, professional name, professional name. Then I searched for the word ' engineer ', which is in the university name and professional name section, how do I print on the template page?
Controller:
if ($result ["univ_name"] = $Univ->where ($map)->select ())
{
$result = current ($result);
$this->assign (' list ', $result);
}
if ($content ["Job_name"]= $Job->where ($NAP)->select ())
{
$result = current ($content);
$this->assign (' list ', $result);
}
Template:
I output this, if the two fields do not repeat the word line, if there are duplicates can only output the second if the data
------Solution--------------------
Logic has been sent to you
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.