# Number of entries to load per page.
$limit = 3;
# Get the page number from GET, or set it to 0.
$page = isset ( $_GET['page'] ) && $_GET['page'] ? (int)$_GET['page'] : 1;
if($page==1)
$start = 0;
else
$start = ($page-1) * $limit;
# Get the total number of posts. We need this to know when we've reached the last # page. # You probably want to do some error handling here, if mysql queries fail.
$statement = $mysqli->prepare ("SELECT COUNT(*) FROM sr_projets WHERE actif=1");
$statement->execute();
$statement->bind_result($count);
$statement->fetch();
#The result is now in the $count variable.
$statement->close();
$act = 1;
$stmt = $mysqli->prepare("SELECT p.id, c.client, p.titre, p.description, p.lien FROM sr_projets AS p LEFT JOIN sr_clients AS c ON p.id_client = c.id WHERE p.actif = ? ORDER BY p.ordre ASC, p.id DESC LIMIT ?, ?");
// Bind a variable to the parameter as a string.
$stmt->bind_param("iii", $act, $start, $limit);
if (!$stmt->execute()) {
echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
}
$stmt->store_result();
$stmt->bind_result($id, $client, $projet, $description, $lien);
?>
while ($stmt->fetch()){
// logos en premier
if($id == 113){
?>