EDIT: It turns out that I’ve been barking up the wrong tree so to
speak. I’ve edited the question to make it at least useful for others
who get the error.
For all those who get the following error when trying to execute a prepared PDO query:
Warning: PDOStatement::execute() [pdostatement.execute]:
SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
on line 26
See my answer below.
That means you are passing more array values in
$query->execture($array)than you have:valuesin the query. If you are getting a similar but differently worded error, it mean you have more:valuesin the query than you have in the array. For example:This would give an error because, although you are passing “username”, it is never used in the query. Hope this helps someone!