使用pdo将数据插入表(mysql)时出现此错误。
这是我的代码:
$stmt = $this->db->prepare('INSERT INTO t_user (UserEmail, UserPassword, UserFirstName, UserLastName, UserSex, UserPhoneNumbers, UserNationalIdCardNo
, UserBirthday, UserAddress, UserDetails, UserRoles, UserDecription) VALUES (:UserEmail, :UserPassword, :UserFirstName, :UserLastName, :UserSex, :UserPhoneNumbers
, :UserNationalIdCardNo, :UserBirthday, :UserAddress, :UserDetails, :UserRoles, :UserDecription)');
$stmt->bindValue(':UserEmail', $entity->UserEmail);
$stmt->bindValue(':UserPassword', md5($entity->UserPassword));
$stmt->bindValue(':UserFirstName', $entity->UserFirstName);
$stmt->bindValue(':UserLastName', $entity->UserLastName);
$stmt->bindValue(':UserSex', $entity->UserSex);
$stmt->bindValue(':UserPhoneNumbers', json_encode($entity->UserPhoneNumbers));
$stmt->bindValue(':UserNationalIdCardNo', $entity->UserNationalIdCardNo);
$stmt->bindValue(':UserBirthday', $entity->UserBirthday);
$stmt->bindValue(':UserAddress', $entity->UserAddress);
$stmt->bindValue(':UserDetails', $entity->UserDetails);
$stmt->bindValue(':UserRoles', json_encode($entity->UserRoles));
$stmt->bindValue(':UserDescription', $entity->UserDescription);
$result = $stmt->execute();
请帮帮我
答案 0 :(得分:0)
您拼写:UserDecription
,在您的查询中,它应为:UserDescription