我一直在用准备好的陈述为我的生命而战。我尝试过的每个站点都有不同的语法。这是我要完成的工作:
$stmt = $mysqli->prepare("SELECT IdNum FROM TOAWorkOrdersNew WHERE WorkDate = ? AND TechNum = ?");
$stmt2 = $mysqli->prepare("SELECT IdNum FROM CallVolume WHERE WorkDate = ? AND ANI = ?");
---loop
----loop
$stmt->bind_param('ss', $IncDate, $TechNum);
$stmt->execute();
$stmt->store_result();
$WorkOrders = $stmt->num_rows;
$SubWorkOrders = $SubWorkOrders + $WorkOrders;
$stmt->free_result();
$stmt->close();
$stmt2->bind_param('ss', $IncDate, $CellNum);
$stmt2->execute();
$stmt2->store_result();
$CallCount = $stmt2->num_rows;
$SubCallCount = $SubCallCount + $CallCount;
$stmt2->free_result();
$stmt2->close();
}
}
语句返回 NULL。