Mysql
 sql >> Base de données >  >> RDS >> Mysql

Pagination en PDO PHP

non testé

$page  = 1;
$limit = 20;
$start = $page * $limit;

$conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE);
$sth = $conn->prepare("SELECT * FROM directory WHERE user_active LIMIT ?,?");
$sth->execute(array($start,$limit));