Связывание HTML-формы с базой данных
я продолжаю получать эту ошибку
Фатальная ошибка: непойманные ошибка: вызов функции-члена bind_param() на bool в /пользователи/Тобо/сайты/прототип/подключить.РНР:193 трассировка стека: #0 {главная} брошены в /Users/Tobo/Sites/prototype/connect.php на линии 193
Это мой код.
<?php if(isset($_POST['Documentno'])){ $Documentno = $_POST['Documentno']; } if(isset($Documentno)){ echo $Documentno; } if(isset($_POST['DocumentCategory'])){ $DocumentCategory = $_POST['DocumentCategory']; } if(isset($DocumentCategory)){ echo $DocumentCategory; } if(isset($_POST['CertificateNo'])){ $CertificateNo = $_POST['CertificateNo']; } if(isset($CertificateNo)){ echo $CertificateNo; } if(isset($_POST['Revision'])){ $Revision = $_POST['Revision']; } if(isset($Revision)){ echo $Revision; } if(isset($_POST['Duedate'])){ $Duedate = $_POST['Duedate']; } if(isset($Duedate)){ echo $Duedate; } if(isset($_POST['IMCAD018ref'])){ $IMCAD018ref = $_POST['IMCAD018ref']; } if(isset($IMCAD018ref)){ echo $IMCAD018ref; } if(isset($_POST['DESIGNAuditref'])){ $DESIGNAuditref = $_POST['DESIGNAuditref']; } if(isset($DESIGNAuditref)){ echo $DESIGNAuditref; } if(isset($_POST['Description'])){ $Description = $_POST['Description']; } if(isset($Description)){ echo $Description; } if(isset($_POST['Make'])){ $Make = $_POST['Make']; } if(isset($Make)){ echo $Make; } if(isset($_POST['AssetNumber'])){ $AssetNumber = $_POST['AssetNumber']; } if(isset($AssetNumber)){ echo $AssetNumber; } if(isset($_POST['COMMENTS'])){ $COMMENTS = $_POST['COMMENTS']; } if(isset($COMMENTS)){ echo $COMMENTS; } if(isset($_POST['TestProcedureRef'])){ $TestProcedureRef = $_POST['TestProcedureRef']; } if(isset($TestProcedureRef)){ echo $TestProcedureRef; } if(isset($_POST['PlaceofInspection'])){ $PlaceofInspection = $_POST['PlaceofInspection']; } if(isset($PlaceofInspection)){ echo $PlaceofInspection; } if(isset($_POST['DateofInspection'])){ $DateofInspection = $_POST['DateofInspection']; } if(isset($DateofInspection)){ echo $DateofInspection; } if(isset($_POST['DateofNextInspection'])){ $DateofInspection = $_POST['DateofNextInspection']; } if(isset($DateofNextInspection)){ echo $DateofNextInspection; } if(isset($_POST['TestResults'])){ $TestResults = $_POST['TestResults']; } if(isset($TestResults)){ echo $TestResults; } if(isset($_POST['Doneby'])){ $Doneby = $_POST['Doneby']; } if(isset($Doneby)){ echo $Doneby; } if(isset($_POST['Approval'])){ $Approval = $_POST['Approval']; } if(isset($Approval)){ echo $Approval; } if(isset($_POST['Date'])){ $Date = $_POST['Date']; } if(isset($Date)){ echo $Date; } //. database connection code $conn = new mysqli('127.0.0.1', 'root', 'toboroot', 'sys'); if($conn->connect_error){ die('Connection Failed : '.$conn->connect_error); }else{ $stmt = $conn->prepare("insert into database(Documentno, DocumentCategory, DepartmentOwner, CertificateNo, Revision, Duedate, IMCAD018ref, DESIGNAuditref, Description, Make, AssetNumber, COMMENTS, TestProcedureRef, PlaceofInspection, DateofInspection, DateofNextInspection, TestResults, Doneby, Approval, Date ) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $stmt->bind_param("ssssssssssssssssssss", ['Documentno'], ['DocumentCategory'], ['DepartmentOwner'], ['CertificateNo'], ['Revision'], ['Duedate'], ['IMCAD018ref'], ['DESIGNAuditref'], ['Description'], ['Make'], ['AssetNumber'], ['COMMENTS'], ['TestProcedureRef'], ['PlaceofInspection'], ['DateofInspection'], ['DateofNextInspection'], ['TestResults'], ['Doneby'], ['Approval'], ['Date']); $stmt->execute(); echo "Record stored"; $stmt->close(); $conn->close(); } ?>
Что я уже пробовал:
попытка изменить кавычки имен полей с "на", как кто-то предложил, не сработала