1
中的準備語句中的字段數量我正在使用一個準備好的語句我已經傳遞了與bind_param中相同數量的變量,正如我所期待的,但它仍然是ginving我變盤點的誤差不match.here是代碼mysqli_stmt :: bind_result():綁定變量的數量不匹配
$query="select `shipping_name`,`shipping_address1`,`shipping_address12`,`shipping_city`,`shipping_state`,`shipping_postalcode`,`billing_name`,`billing_address2`,`billing_address22`,`billing_city`,`billing_state`,`billing_postalcode` from puppy_shipping where unique_id=?";
$stmt = $db->prepare($query);
$bind='ssssssssssss';
if($stmt){
$stmt->bind_param('s',$id);
$stmt->execute();
$stmt->bind_result($bind,$shipping_name,$shipping_address1,$shipping_address12,$shipping_city,$shipping_state,$shipping_postalcode,$billing_name,$billing_address2,$billing_address22,$billing_city,$billing_state,$billing_postalcode);
while ($stmt->fetch())
{
}
$stmt->close();
}
'bind_result()'不具有約束力的類型(比如'bind_param()'),所以放下'$ bind'變量。 – Qirel
完成!現在我有這個錯誤!無法在 – uneeb
中通過參考傳遞參數1,現在看起來像這樣! $ stmt-> bind_result( 'ssssssssssss',$ shipping_name,$ shipping_address1,$ shipping_address12,$ shipping_city,$ shipping_state,$ shipping_postalcode,$ billing_name,$ billing_address2,$ billing_address22,$ billing_city,$ billing_state,$ billing_postalcode); – uneeb