Recently just had the ” PDOException thrown “SQLSTATE[HY093]: Invalid parameter” ” error.

This caused due to me having a query like this.

$dbq->prepare(’some query with :some vars in it like :this’)
$dbq->bindParam(:some, ’some string’);
$dbq->bindParam(:this, ‘another string’);
$dbq->bindParam(:oops, ‘this string is not in the prepared statement’);
$dbq->execute();

When i removed the :oops bind param it worked. Hope this helps someone else and saves time. PHP v 5.2, Mysql v5