Zencart页面自定义查询sql


1、先定义sql语句再查询

<?php
    $zc_sql = "SELECT a.products_image as pImg,a.products_model as pNo,b.products_name as pName FROM " . TABLE_PRODUCTS . " a," . TABLE_PRODUCTS_DESCRIPTION . " b where a.products_id=38 and a.products_id=b.products_id";
    $zc_rst = $db->Execute($zc_sql);
?>

2、查询结果

<?php echo $zc_rst->fields['pNo'];?>

声明:Windows 10 专业版|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - Zencart页面自定义查询sql


Carpe Diem and Do what I like