1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <?php
mysql_connect("localhost", "root", "");
mysql_select_db("news");
$nombreDeMessagesParPage = 6;
if (isset($_GET['page']))
{
$page = $_GET['page'];
}
else
{
$page = 1;
}
$premierMessageAafficher = ($page - 1) * $nombreDeMessagesParPage;
$reponse = mysql_query('SELECT * FROM portfolio ORDER BY id DESC LIMIT ' . $premierMessageAafficher . ', ' . $nombreDeMessagesParPage);
while ($donnees = mysql_fetch_array($reponse))
{
?>
<p><strong><?php echo $donnees['titre']; ?></strong>
<?php
}
mysql_close();
?> |