簡體   English   中英

這種類型的數據庫如何解決?

[英]How to solve this type of database?

提交表單時出現此類錯誤:致命錯誤:未捕獲錯誤:調用 C:\\xampp\\htdocs\\rubina\\fuerte_developers_1\\config.php:31 中的 bool 上的成員函數 bind_param() 堆棧跟蹤:#0 {main } 扔在 C:\\xampp\\htdocs\\rubina\\fuerte_developers_1\\config.php 第 31 行

我的 config.php 代碼

<?php
session_start();

$fname= $_POST['fname'];
$lname= $_POST['lname'];
$email= $_POST['email'];
$area_code= $_POST['area_code'];
$phone= $_POST['phone'];
$method= $_POST['method'];
$cmpny = $_POST['cmpny'];
$service= $_POST['service'];
$contact= $_POST['contact'];
$amount= $_POST['amount'];
$currency= $_POST['currency'];
$des= $_POST['des'];
$website= $_POST['website'];




$conn = new mysqli('localhost', 'root','','creative');
if($conn->connect_error){
    die('connection failed : ' .$conn->connect_error);

}  

else{
    $stmt = $conn->prepare("insert into creative(fname,lname,email,area_code,phone,method,cmpny,service,contact,amount,currency,des,website) values(?,?,?,?,?,?,?,?,?,?,?,?,?)");

    $stmt->bind_param("sssssssssssss", $fname,$lname,$email,$area_code,$phone,$method,$cmpny,$service,$contact,$amount,$currency,$des,$website);

    $stmt->execute();

    $stmt->close();
    $conn->close();
}

$_SESSION["id"]=1;



header('location:index.php');


?>```




該錯誤意味着$stmt不是您認為的那樣。 它不是一個對象 - 現在它是false因為在准備語句時出現錯誤,這意味着您的 SQL 已關閉。

我的猜測是您的一個字段拼寫錯誤(可能是cmpny字段?)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM