21,886
社区成员
发帖
与我相关
我的任务
分享
if ($debug==1){echo "数据库连接成功!<br>";}
try{
$stmt = $db->prepare('exec xyyh_stock_trantype_1_24 ?');
$stmt->bindParam(1,$FNumber);
$stmt->execute();
if ($debug==1){ print_r($stmt);echo "<br>";}
$i=1;
echo "<table class='hovertable'><tr><th>日期</th><th>单据编码</th><th>物料编码</th><th>物料名称</th><th>计量单位</th><th>业务类型</th><th>异动数量</th></tr>";
do {
$rowset = $stmt->fetchall(PDO::FETCH_ASSOC);
if ($rowset){
if ($debug==1){print_r($rowset);echo "<br>";}
if ($debug==1){print_r($rowset[$i]);echo "<br>";}
foreach ($rowset as $row) {
echo "<tr>";
echo "<td>".$row["FDate"]."</td><td>".$row["FBillNo"]."</td><td>".$row["FNumber"]."</td><td>".$row["FName"]."</td><td>".$row["FUnitName"]."</td><td>".$row["FTranType"]."</td><td>".$row["FQty"]."</td>";
echo "</tr>";
}
}
$i++;
} while ($stmt->nextRowset());
echo "</table>";
}
catch(pdoexception $e){
print '执行失败: '.$e->getMessage();
exit();
}
先凑合用一下