Salve,
non mi riesce di fare una paginazione come voglio io in pratica:
stampo tutte le stringhe da un db con limite 10 per pagina:
Codice PHP:
$sql_pag = mysql_query("SELECT * FROM Lingue ORDER BY IDLingue DESC") or die( mysql_error( ) );
$res_amt = mysql_num_rows($sql_pag);
$last = ceil($res_amt/$limit);
if ($pagenum < 1)
{
$pagenum = 1;
}
elseif ($pagenum > $last)
{
$pagenum = $last;
}
//limite da inserire nella query sottostante
$max = 'limit ' .($pagenum - 1) * $limit .',' .$limit;
//si crea un select che salta al volo nella pagina
$str = '<select name="listingMenu" class="textFields" onchange="jumpMenu(\'parent\',this,0)">';
//query con
$sql = mysql_query("SELECT * FROM Lingue ORDER BY IDLingue DESC $max") or die( mysql_error() );
while($rows = mysql_fetch_assoc($sql))
{
$str .= '<option value="index.php?modID=87&compID=104&id='.$rows['IDLingue'].'&page='.$pagenum.'#'.$rows['IDLingue'].'">[['.$rows['IDLingue'].']]</option>';
}
$str .= "</select>";
return $str;
}
il problema è che vorrei , quando seleziono un articolo, andare nella pagina di quell'articolo , cioè la stringa esatta scritta con
Codice PHP:
'&page='.$pagenum.'
Spero di esser stato chiaro....
Grazie