Q: execute() SQLSTATE[HY093]: Invalid parameter number I have a problem in my code and I don't understand that!
here is the part of my code that has problem
$conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);
$sql = "SELECT SQL_CALC_FOUND_ROWS *, UNIX_TIMESTAMP(publicationDate) AS publicationDate FROM NEWS order by " . mysql_real_escape_string($order) . " LIMIT :numROws";
$st = $conn -> prepare($sql);
$st -> bindValue(":numRows", $numRows, PDO::PARAM_INT);
$st -> execute();

if it is not clear please tell.

A: It looks like you might have a simple typo. 
In your SQL, you write:
...LIMIT :numROws";

But then you're binding:
$st -> bindValue(":numRows", $numRows, PDO::PARAM_INT);

PHP is case sensitive, so :numROws and :numRows are not the same.

A: replace:
$st -> bindValue(":numRows", $numRows, PDO::PARAM_INT);

with:
$st -> bindValue(":numROws", $numRows, PDO::PARAM_INT);

