正如標題所暗示的,我嘗試過不同的設置,還有其他一些問題。調用未定義的方法mysqli_stmt :: bindParam()
$conn = new mysqli("localhost","root","root","site_db");
foreach($webdesigns as $designer){
$whmcs_id = $designer['id'];
$email = $designer['email'];
$portfolio = json_encode($designer['designs'],JSON_FORCE_OBJECT);
$stmt = $conn->prepare("INSERT INTO partners (whmcs_id,email,portfolio) VALUES (?, ? , ?)");
$stmt->bindParam(1, $whmcs_id);
$stmt->bindParam(2, $email);
$stmt->bindParam(3, $portfolio);
echo $stmt->execute();
}
它必須是'bind_param'。 'bindParam'是'PDO'而不是'mysqli_' – Jens