grazie, una cosa, se poi volessi fare il multi pagina, posso adattare questo codice, vero?
funziona lo stesso, no?
Codice PHP:
<?php //Visualizzazione elmenti in più pagine
$limit = 10; // articoli per pagina
$result = mysql_query("SELECT COUNT(*) FROM recensioni WHERE id_struttura=\"$id\" and stato=1 and visibile=1 ");
$tot=mysql_fetch_array($result);
$page = isset($_GET['p']) ? $_GET['p'] : 1;
$totals = $tot[0];
$totals_pages = ceil($totals / $limit);
$recensione_struttura = mysql_query("SELECT * FROM recensioni WHERE id_struttura=\"$id\" and stato=1 and visibile=1 ORDER BY ID DESC limit ".(($page - 1) * $limit).",".$limit);
//Fine visualizzazione
while($recensione = mysql_fetch_array($recensione_struttura)){
<?php }?>
<div align="center">Pagina <?php echo $page; ?> di <?php echo $totals_pages; ?>
<?php
if($page - 1 > 0) {
echo '<a href=index.php?page=1&id='.$id.'&recensioni=1&p='.($page - 1).'>< Precedente</a> | ';
}else{
echo '< Precedente | ';}
if($page + 1 <= $totals_pages){
echo '<a href=index.php?page=1&id='.$id.'&recensioni=1&p='.($page + 1).'>Successivo ></a>';
}else{
echo 'Successivo >';}
?>
</div>