0
我正在使用PDO的更新功能更新表單。由於某種原因,它沒有經過。PDO更新故障
這裏是代碼:
$data = "UPDATE insuranceverificationdisclaimer SET InsCoName =:insur, PhoneNumber = :phone, Policy = :policy, InsuredName = :insurname
, MailingAdrs = :mailingad, EffDate = :effdate, ExpDate = :expdate, Email1 = :email, YrVehicle = :yr, Make = :make
, Model = :model, VIN = :vin, TraineeUserName = :user, EmpName = :empname, EmpCoName = :empcomp, AgencyNumber = :agnum
, SignDate = :signdate, AgentName = :agname, AgentPhone = :agphone, AgentEmail = :agemail, Combinedlimit = :csl, bodyinjur = :body
, bodyinjureachacc = :acc
, propertydmg = :prop WHERE TraineeUsername = :user";
echo"1";
$insertdata = $DBH->prepare($data);
$insertdata->execute(array(':insur' => $compname, ':phone' => $phone , ':policy' => $policynum, ':insurname' => $nameofPolicyholder
, ':mailingad' => $newMailingAdrs, ':effdate' => $Policyeffdate, ':expdate' => $Policyexpdate, ':email' => $newEmployeeEmail
, ':yr' => $YearOfVehicle, ':make' => $MakeOfVehicle, ':model' => $ModelOfVehicle, ':vin' => $Vehicleid, ':user' => $username, ':empname' => $EmployeeName, ':empcomp' => $EmployeeCompanyName, ':agnum' => $Agencynum
, ':signdate' => $TodaysDate, ':agname' => $agentname, ':agphone' => $agentphone, ':agemail' => $agentemail, ':csl' => $singlelimit
, ':body' => $bodyinjur, ':acc' => $eachacc, ':prop' => $propertydmg));
凡, ':csl' => $singlelimit, ':body' => $bodyinjur, ':acc' => $eachacc, ':prop' => $propertydmg
開始這是不正常的功能,這些都在數據庫整數,值是整數。如果我從select和數組中刪除它將工作,但除此之外它不會。
讓我知道你是否需要別的東西!
UDATED ---------------------------
不會去通過,一旦你打執行只是停留白頁。
「不工作」是什麼意思?錯誤的結果?異常拋出? –
執行後不執行 –
當您在PHP中遇到一個白頁(致命錯誤)時,您需要打開display_errors。 '的error_reporting(E_ALL); ini_set('display_errors',1);' –