我为select query
$product_info = $this->mysqliengine->prepare("select product_id, sku from product limit 10");
$product_info->execute();
$res = $product_info->bind_result();
while($row = $res->fetch_assoc()) {
echo $row['sku'].'<br />';
}
但它显示致命错误
致命错误:在非对象上调用成员函数fetch_assoc()
答案 0 :(得分:0)
尝试自己调试
我希望这会解决
$product_info = $this->mysqliengine->prepare("select product_id, sku from product limit 10");
$product_info->execute();
$product_info->bind_result($product_id,$sku);
while($product_info->fetch()) {
echo $product_id.'<br />';
}
$product_info->close();