<?php try { $db = new PDO(\"mysql:host=localhost;dbname=DBNAME\", \"USER\", \"PASSWD\"); $stmt = $db->prepare(\"SELECT id, name FROM testdb ORDER BY time DESC LIMIT :index, 10\");