蔭收到此錯誤爲什麼iam在error_log文件中得到與bind_result相關的錯誤以及如何解決?
[07月 - 2017年11點48分47秒UTC] PHP的警告:mysqli_stmt :: bind_result(): 綁定變量的數量不匹配字段數準備 聲明
$stmt = $con->prepare("SELECT * FROM table where Id =?");
$stmt->bind_param("s", $_POST['Id']);
$stmt->execute();
$result = $stmt-> bind_result($Id);
$numRows = $result->num_rows;
if($numRows > 0) {
if($row = $result->fetch_assoc())
{
$Taxname=$row['TaxName'];
$Tid=$row['Id'];
}}
您在'$ Id'中獲得的價值是多少? – Gunaseelan
@Gunaseelan sir .i只需要知道bind_result中的變量應該是什麼?數值來自數據庫嗎? – krish
你在表名'table'中得到了多少列和什麼是列值? – Gunaseelan