我一直试图让这个单一的PDO语句工作,它只是不想执行!
我有数百个类似的语句,它们都执行得很好,但这个单一的语句无法执行。甚至没有任何错误消息要显示。要么我忽视了一些非常简单的东西,要么就是出了问题。
<?php
require_once('inc/connect_dbo.php');
//Add dummy client
$first_name = "John";
$first_name = "Smith";
$client_type = "individual";
$individual_email = 'john.smith@email.com';
$gender = 'male';
$primary_phone = '1234567890';
$address = '1 Yonge St, Toronto, ON';
$query = $dbo->prepare("INSERT INTO clients SET account_id = ?, first_name = ?, last_name = ?, type = ?, email = ?, gender = ?, primary_phone = ?, address = ?");
$query->execute(array($account_id, $first_name, $last_name, $client_type, $individual_email, $gender, $primary_phone, $address));
$client_id = $dbo->lastInsertId();
print_r($dbo->errorInfo());
echo $client_id;
exit;
?>
errorInfo的输出是emtpy:
Array ( [0] => 00000 [1] => [2] => ) 0
提前致谢!