$str = $_GET["str"]; // like ?page=...
if(!$str){
$str = "1";
}
$limit = "7" // how many rows...
$start = ($str * $limit) - $limit; // starting from
$select = mysql_query("SELECT * FROM komentari WHERE za_proizvod='$id' ORDER BY id ASC LIMIT $start,$limit ");
while($a=mysql_fetch_array($select)){
$komentari[] = $a;
}
$ukupno_query = mysql_query("SELECT * FROM komentari WHERE za_proizvod='$id'");
$ukupno = mysql_num_rows($ukupno_query);
$stranica = ceil($ukupno/$limit); // number of pages
$smarty->assign('stranice', $stranice); //here I will show pages...
I don't know how to show:
1 2 3 4 5 6 7 8 ... etc.
If I have 50 pages, I want this:
1 2 3 4 5 ... 46 47 48 49 50
If I opet 4th page it should be:
2 3 [U]4[/U] 5 6 ... 46 47 48 49 50
Current page should be underline.
Please help me.