我试图执行一个INSERT查询,确保只插入一行并避免重复插入/ 这是我在PHP文件中使用的SQL字符串:
$sql = "INSERT INTO `users`( `user_name`,`email`, `password`, `active`) VALUES (:name, :email, :pass, :active) LIMIT 1";
我收到以下错误:
Calling BeforeException -> string(211) "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 1' at line 1"
我认为MariaDB Insert命令不使用LIMIT语法。 请建议。谢谢