列计数与PHP第1行的值计数不匹配

时间:2019-04-05 03:02:16

标签: php pdo

我正在数据库中插入35个数据。我检查了列数,值数和查询以及所有匹配的项目。我不知道为什么会发生此错误。

我尝试在数据库中手动插入数据并插入了数据。所有变量中都有数据

$sql = $conn->prepare("INSERT INTO tblContacts (ContactID, FileAs, FirstName, MiddleName, LastName, Position, Company, CompanyID, RetailerType, PresStreet, PresBarangay, PresDistrict, PresTown, PresProvince, PresCountry, Landmark, CustomerRemarks, RecordDate, StartTime, EndTime, Telephone1, Telephone2, Mobile, Email, MobilePhoto1, MobilePhoto2, MobilePhoto3, MobileVideo, Employee, Customer, Supervisor, RecordLog, Deleted, ClientUpdate, ServerUpdate) VALUES(:contactid, :fileas, :fistname, :middlename, :lastname, :position, :company, :companyid, :retailertype, :street, :barangay, :district, :town, :province, :country, :landmark, :remarks, :recorddate, :starttime, :endtime, :tel1, :tel2, :mobile, :email, :mobilephoto1, :mobilephoto2, :mobilephoto3, :mobilevideo, :employee, :customer, :supervisor, :recordlog, :deleted, :clientupdate, :serverupdate)", $cursor);

$sql->bindValue(":contactid", $ContactID);
$sql->bindValue(":fileas", $FileAs);
$sql->bindValue(":fistname", $FirstName);
$sql->bindValue(":middlename", $MiddleName);
$sql->bindValue(":lastname", $LastName);
$sql->bindValue(":position", $Position);
$sql->bindValue(":company", $Company);
$sql->bindValue(":companyid", $CompanyID);
$sql->bindValue(":retailertype", $RetailerType);
$sql->bindValue(":street", $PresStreet);
$sql->bindValue(":barangay", $PresBarangay);
$sql->bindValue(":district", $PresDistrict);
$sql->bindValue(":town", $PresTown);
$sql->bindValue(":province", $PresProvince);
$sql->bindValue(":country", $PresCountry);
$sql->bindValue(":landmark", $Landmark);
$sql->bindValue(":remarks", $Remarks);
$sql->bindValue(":recorddate", $RDate);
$sql->bindValue(":starttime", $StartTime);
$sql->bindValue(":endtime", $EndTime);
$sql->bindValue(":tel1", $Telephone1);
$sql->bindValue(":tel2", $Telephone2);
$sql->bindValue(":mobile", $Mobile);
$sql->bindValue(":email", $Email);
$sql->bindValue(":mobilephoto1", $MobilePhoto1);
$sql->bindValue(":mobilephoto2", $MobilePhoto2);
$sql->bindValue(":mobilephoto3", $MobilePhoto3);
$sql->bindValue(":mobilevideo", $MobileVideo);
$sql->bindValue(":employee", $Employee);
$sql->bindValue(":customer", $Customer);
$sql->bindValue(":supervisor", $Supervisor);
$sql->bindValue(":recordlog", $RecordLog);
$sql->bindValue(":deleted", $Deleted);
$sql->bindValue(":clientupdate", $client_update);
$sql->bindValue(":serverupdate", '01-01-0001');

if($sql->execute()){
    $ar[] = array(
        "Message" => "Inserted"
    );
 }
else{
    $ar[] = array(
        "Message" => $sql->errorInfo()
    );
}

0 个答案:

没有答案