I\'m receiving an error whenever I attempt to insert into my database using PDO.
public function save($primaryKey = \"\") {
$validate = $this->rules()
I think this might be because you have decared each binding twice in the statement e.g. :firstname
appears in the VALUES
clause as well as the ON DUPLICATE KEY UPDATE
clause.
You only pass 8 bindings to the $stmt->execute
but PDO is looking for 16.
You could try naming them slightly different in the ON DUPLICATE KEY UPDATE
clause giving you a query such as e.g.
INSERT INTO am_administrator (firstName,lastName,username,password,email,isSuperUser,dateCreated,dateLastModified) VALUES (:firstName,:lastName,:username,:password,:email,:isSuperUser,:dateCreated,:dateLastModified) ON DUPLICATE KEY UPDATE firstName = :update_firstName,lastName = :update_lastName,username = :update_username,password = :update_password,email = :update_email,isSuperUser = :update_isSuperUser,dateCreated = :update_dateCreated,dateLastModified = :update_dateLastModified;