PDO SQL 状态“00000”但仍然错误?
任何人都可以解释为什么
$sql->execute($params);
返回 ,而FALSE
print $pdo->errorCode();
print_r($pdo->errorInfo());
两者都返回,这意味着根据文档成功?它是一个,实际上没有任何东西入到数据库中...那么,为什么我从 中收到成功消息?SQLSTATE
00000
INSERT
SQLSTATE
如果它有帮助,这是代码...
$sql = $pdo->prepare("
INSERT INTO user (
username, fname, pass, salt, email,
loc_id_home, country_id_home, region_id_home,
cont_id_home, timestamp_reg, timestamp_upd, timestamp_lastonline,
online_status, gender, birthdate
)
VALUES (
:username,:fname,:pass,:random_salt,:email,
:loc_id_home,:country_id_home,:region_id_home,
:cont_id_home,'".time()."','".time()."','".time()."',
1,:gender,:birthdate)
");
$params=array(
':username'=>$username,
':fname'=>$fname,
':pass'=>$pass,
':random_salt'=>$random_salt,
':email'=>$email,
':loc_id_home'=>$loc_id_home,
':country_id_home'=>$country,
':region_id_home'=>$region,
':cont_id_home'=>$continent,
':gender'=>$gender,
':birthdate'=>$birthdate
);
$sql->execute($params);
print $pdo->errorCode();
print_r($pdo->errorInfo());