这是搜索产品的查询。数据包含来自不同两个表的产品列表。
$where = " Jewellery_Title like '%$id%' or Jewellery_SKU like '%$id%' and Jewellery_Status='Active'";
// $where_s = implode(' and ', $where);
$sql = "select * from jewellery where (".$where."".$jewellery_name." ) $metal_where order by rank asc";
$res1 = query($con,$sql);
$total1 = row($res1);
$where = " Ring_Title like '%$id%' or Ring_SKU like '%$id%' $ring_name
and Ring_Status='Active'";
$sql = "select * from rings where (".$where.") $metal_where order by rank asc";
$res2 = query($con,$sql);
$total2 = row($res2);
答案 0 :(得分:2)
如上所述,在mysql查询中使用别名并运行数组合并。
$scope.et = {};
$scope.et.getNumPadStyle = {
"padding-left" : "25px"
}
如果您想要加入查询,请使用此
$sql=select jewelleryname as name from jewellery
$sql1=select ringname as name from rings
// more code
$total = row($res1);
$total1 = row($res2);
$C = array_merge($total , $total1);