时间:2021-07-01 10:21:17 帮助过:8人阅读
stmt_init(); //为执行准备语句 $stmt->prepare($query); //执行语句 $stmt->execute(); //绑定结果参数 $stmt->bind_result($name,$pwd); //循环处理结果并输出数据 while($stmt->fetch()){ printf("%s, %s, %s
function selectLink($oid){ $sql = "select o.oid,l.lid,c.cid,comName,comPrice,ordTime from mis_order o,mis_link l,mis_commodity c where o.oid=l.lid and c.cid=l.cid and o.oid=?"; $stmt = $this->mysqli->prepare($sql); $stmt->bind_param("i",$oid); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($oid,$lid,$cid,$comName,$comPrice,$ordTime); $rows = $stmt->affected_rows; if($rows > 0){ $arrLink = array(); while($stmt->fetch()){ $arr = array( "oid" => $oid, "lid" => $lid, "cid" => $cid, "comName" => $comName, "comPrice" => $comPrice, "ordTime" => $ordTime ); array_push($arrLink,$arr); } return $arrLink; }else{ echo "查询订单明细失败!
"; } }