MySQLi PHP Pagination

[php]<?php

include ‘header.php’;
$getAllUsers = $db->query(“SELECT * FROM users ORDER BY ID ASC”);
$getAllNum = $getAllUsers->num_rows;
$getOnline = $db->query(“SELECT * FROM users WHERE $now < expireT”);
$numOnline = $getOnline->num_rows;
$counter = 0;
echo "

"; while ($getAU = $getAllUsers->fetch_object()) { $counter++; echo " "; if($counter > 5) { echo ""; $counter=0; } }

echo "


Users Online($numOnline)



Search:

";
$username = strip_tags(stripslashes($_POST[‘susername’]));
$search = strip_tags(stripslashes($_POST[‘search’]));
if($search) {
header (“Location: ?search=$username”);
}
if($_GET[‘search’]) {
$usernametoSearch = $_GET[‘search’];
//$getResult = $db->query(“SELECT * FROM users WHERE Username LIKE ‘%$usernameToSearch%’”);
echo "


$getAU->Username
";
while($gR = $getResult->fetch_object()) {
echo "";
}
} // end if search
[/php]

I recently switched to MySQLi and im having trouble adding pagination to the script above.
Can anyone help me?
Thanks in advance.

$gR->Username
Sponsor our Newsletter | Privacy Policy | Terms of Service