I’ve created a module which outputs a list/table which has a list of names/email address, but I don’t know how to get it to paginate?
Is there a function like this "$modx->paginate($sql, $page, $offset, $limit=10)"
If not, how do you do pagination in a module?
$sql = 'SELECT * FROM tablename';
$res = mysql_query($sql);
while ( $row=mysql_fetch_array($result) )
{
$list .= '
<tr>
<td>'.$row['id'].'</td>
<td>'.$row['name'].'</td>
<td>'.$row['email'].'</td>
<td><a href="index.php?a=112&id='.$this->config['module_id'].'&action=delete">Delete</a></td>
</tr>';
} // wend
I want to be able to paginate the above, but am not sure how to do it.
Thanks.