【发布时间】:2019-11-27 12:45:53
【问题描述】:
我收到一个参数错误,但我真的不知道如何修复它。我做错了什么?
function ToonProduct($productID) {
$query = "SELECT *
FROM stockitems s
JOIN stockitemholdings sh ON s.StockItemID = sh.StockItemID
WHERE s.StockItemID = :productid";
$query = connectionDB()->prepare ($query);
$query->bindParam(":productid", $productID, PDO::PARAM_INT);
$query->execute();
return connectionDB()->query( $query )->fetch(PDO::PARAM_STR);
这是我得到的输出:
Warning: PDO::query() expects parameter 1 to be string, object given in C:\xampp\htdocs\wwi\includes\queries.php on line 47
这是第 47 行:
return connectionDB()->query( $query )->fetch(PDO::PARAM_STR);
【问题讨论】:
-
更新您的问题并添加完整的错误消息文本