$statement = $connection->prepare("INSERT INTO test(emailAddress, password) VALUES(:emailAddress, :password)");
$data = array("emailAddress" => "test1", "password" => "test", "abc" => 123);
if($statement->execute($data)) {
echo $connection->lastInsertId();
} else {
echo "error";
}
I know the number of tokens are more than the required, but sometimes my array could have more and I need them.
Invalid parameter number: number of bound variables does not match number of tokens'
Can PDO ignore extra parameters?