[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 "
$getAU->Username
|
";
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 "
";
while($gR = $getResult->fetch_object()) {
echo " $gR->Username | ";
}
} // 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.