How does PHP $_g different data from two data tables?

Source: Internet
Author: User
This is the original invocation:
$_g[' db ']->from (' dbpre_subject ');
$_g[' db ']->select (' * ');
$_g[' db ']->where (' city_id ', Array (0,$_city[' aid '));
$_g[' db ']->where_concat_like (' Name,subname ', "%{$q}%");
$_g[' db ']->where (' status ', 1);

Now I want to base on this, in call dbpre_subject_product_new this data table of C_product_price and c_product_content these two fields,,, change how to write,,, first thank you to the great God

Paste the source code.

!defined (' In_mudder ') && exit (' Access Denied ');

$city _id = _get (' city_id ', null, mf_int_key);
if ($city _id>0) {

$citys = $_G['loader']->variable('area');if(!$city = $citys[$city_id]) redirect('global_area_city_id_invalid');if(!$city['enabled']) redirect('global_area_city_disabled');init_city($city_id);

}

$q = _input (' keyword ', ' ', mf_text);
if (($_get[' Pathinfo ' | | $_get[' Rewrite ']) && $q && $_g[' charset ']! = ' utf-8 ' && $_g ' cfg ') {

$q = charset_convert($q,'utf-8',$_G['charset']);

}
$q = Str_replace (Array ("RN", "R", "N"), "_t ($q));

$_g[' db ']->from (' dbpre_subject ');
$_g[' db ']->select (' * ');
$_g[' db ']->where (' city_id ', Array (0,$_city[' aid '));
$_g[' db ']->where_concat_like (' Name,subname ', "%{$q}%");
$_g[' db ']->where (' status ', 1);

$multipage = ";
if ($total = $_g[' db ']->count ()) {

$_G['db']->sql_roll_back('from,select,where');$orderby = array($post['ordersort']=>$post['ordertype']);$offset = 10;$start = get_start($_GET['page'], $offset);$_G['db']->order_by($orderby);$_G['db']->limit($start, $offset);$list = $_G['db']->get();if($total) {    $multipage = mobile_page($total, $offset, $_GET['page'], url("item/mobile/do/search/keyword/$q/page/_PAGE_"));}

}

Display templates
if ($_g[' In_ajax ']) {

include mobile_template('item_list_li');output();

}

$title = ' Search Products: '. $q;
Include Mobile_template (' item_list ');

Reply content:

This is the original invocation:
$_g[' db ']->from (' dbpre_subject ');
$_g[' db ']->select (' * ');
$_g[' db ']->where (' city_id ', Array (0,$_city[' aid '));
$_g[' db ']->where_concat_like (' Name,subname ', "%{$q}%");
$_g[' db ']->where (' status ', 1);

Now I want to base on this, in call dbpre_subject_product_new this data table of C_product_price and c_product_content these two fields,,, change how to write,,, first thank you to the great God

Paste the source code.

!defined (' In_mudder ') && exit (' Access Denied ');

$city _id = _get (' city_id ', null, mf_int_key);
if ($city _id>0) {

$citys = $_G['loader']->variable('area');if(!$city = $citys[$city_id]) redirect('global_area_city_id_invalid');if(!$city['enabled']) redirect('global_area_city_disabled');init_city($city_id);

}

$q = _input (' keyword ', ' ', mf_text);
if (($_get[' Pathinfo ' | | $_get[' Rewrite ']) && $q && $_g[' charset ']! = ' utf-8 ' && $_g ' cfg ') {

$q = charset_convert($q,'utf-8',$_G['charset']);

}
$q = Str_replace (Array ("RN", "R", "N"), "_t ($q));

$_g[' db ']->from (' dbpre_subject ');
$_g[' db ']->select (' * ');
$_g[' db ']->where (' city_id ', Array (0,$_city[' aid '));
$_g[' db ']->where_concat_like (' Name,subname ', "%{$q}%");
$_g[' db ']->where (' status ', 1);

$multipage = ";
if ($total = $_g[' db ']->count ()) {

$_G['db']->sql_roll_back('from,select,where');$orderby = array($post['ordersort']=>$post['ordertype']);$offset = 10;$start = get_start($_GET['page'], $offset);$_G['db']->order_by($orderby);$_G['db']->limit($start, $offset);$list = $_G['db']->get();if($total) {    $multipage = mobile_page($total, $offset, $_GET['page'], url("item/mobile/do/search/keyword/$q/page/_PAGE_"));}

}

Display templates
if ($_g[' In_ajax ']) {

include mobile_template('item_list_li');output();

}

$title = ' Search Products: '. $q;
Include Mobile_template (' item_list ');

What kind of frame are you? Different frameworks have different syntax

  • 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.