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:


{$vo. Profession_name} {$vo. Univ_name} {$vo. Job_name}
{$vo. Profession_name}
Domestic University > {$vo. univ_property}
{$vo. Interert_num}
{$count}

I want to review
Concern


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
  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.