$result_array= mysqli_query($conn, "select gmbh,skbh from xiaozu_zngz limit ".$newhead.",".$num);
while ($row = mysqli_fetch_array($result_array)) {
echo $row['gmbh'] . "-" . $row['skbh'];
}
批量更新
update xiaozu_order set
orderdistype = CASE order_shopfadan_cost
WHEN 1.5 THEN 'jin'
WHEN 2 THEN 'zhong'
WHEN 2.5 THEN 'yuan'
END
where addtime > 1588262400 and status = 3
分類查詢
select orderdistype,count(case when orderdistype='jin' then 1 end) as jin,
count(case when orderdistype='zhong' then 1 end) as zhong,
count(case when orderdistype='yuan' then 1 end) as yuan
from xiaozu_order where addtime > 1588262400 and status = 3
group by orderdistype