I am trying to run the query using PDO to get a few rows in descending order.
I am my using MySQL 5.7.27 and PHP 7.2.
$con = new PDO(".....");
$sql1 = "SELECT * FROM `tab` ORDER BY DESC LIMIT :start, :limit";
$sql2 = "SELECT * FROM `tab` ORDER BY DESC LIMIT 0, 2";
$stmt = $con->preapre($sql1);
$stmt->execute(['start'=>0, 'limit'=>2]);
$array = $stmt->fetchAll();
foreach($array as $rows) {
//Getting empty here
}
sql1 doesn't give me any row. However, sql2 gives me rows. I would like to get rows with sql1. What are the mistakes here?