Is there a way to allow the number of parameters passed thru PDO::Execute
to be greater than the number of tokens identified in the prepare
statement?
For example:
$john = Array("name"=>"John", "lastname"=>"Smith","occupation"=>"Citizen");
$pdo = $db->prepare("SELECT * FROM Users WHERE name = :name AND lname = :lastname");
$result = $pdo->execute($john);
In this example, PDO would throw a warning:
Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]:
Invalid parameter number:
number of bound variables does not match number of tokens in...
Can PDO be set to simply ignore additional parameters that don't have a matching token name?