I'm getting this fatal error for using limit in my loop, but if I don't use it I won't be able to break down my content into separate pages. How can I perform the pagination without getting a fatal error every time someone visits the site?
$start = $_GET['start'];
$per_page = 60;
//count recoreds
$data = $db->query("SELECT * FROM artists");
$record_count= $data->rowCount();
//count max pages
$max_pages = $record_count / $per_page;
//may come out as a decimal
if (!$start)
$start = 0;
$sth = $db->prepare("SELECT * FROM artists ORDER BY name LIMIT ?,?");
$sth->execute(array($start,$per_page));
foreach($sth as $info) { //return content }