djmartins Posted November 26, 2005 Report Share Posted November 26, 2005 Lieta taada ka man tie posti vienaa lapaa radas kaut kur jau pie 100 un tas palelina lapas ieladesanos un nav eerti lietotajiem!Kaa lai uztaisa lai vienaa lapaa butu redzami tikai 10 posti un paarejie nakamajas lapas pec principa 1 2 3 <? $host == "localhost"; $port == "3306"; $user == "klauns"; $pass == "subaru"; $database == "news"; $db = mysql_connect("$host:$port", "$user", "$pass"); $result = mysql_query("SELECT * FROM news WHERE cat='$cat' ",$db); while ($res = mysql_fetch_array($result)) } echo("<table width=609 valign=top align=center>"); echo("<td colspan=3 align=center><a href=\"arhive.php?newsid=$res[newsid]\">$res[2]</a></td>"); echo("</table>"); } ?> Link to comment Share on other sites More sharing options...
Vebers Posted November 26, 2005 Report Share Posted November 26, 2005 (edited) $cik = 15 // ievadi cik ierakstus veelies redzeet lapaa if(empty($_GET['lpp'])){ $lpp = 0; } $start = $_GET['lpp'] * $cik; $result = mysql_query("SELECT * FROM news WHERE cat='$cat' LIMIT $start, $cik ",$db); Edited November 26, 2005 by MakaTaNaw Link to comment Share on other sites More sharing options...
v3rb0 Posted November 26, 2005 Report Share Posted November 26, 2005 vardinsh butu limit.. runats daudz daudz reizes par vinju te. Link to comment Share on other sites More sharing options...
djmartins Posted November 26, 2005 Author Report Share Posted November 26, 2005 if(empty($_GET['lpp'])){ $lpp = 0; } sajaa rindinaa uzrada kludu kadel ta? Link to comment Share on other sites More sharing options...
Vebers Posted November 26, 2005 Report Share Posted November 26, 2005 (edited) kljuda ir ieprieksheejaa rindaa pie $cik = 15 vajag $cik = 15; [tur truukst semikols] Edited November 26, 2005 by MakaTaNaw Link to comment Share on other sites More sharing options...
djmartins Posted November 26, 2005 Author Report Share Posted November 26, 2005 tnx nja to es neieveroju :) Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 26, 2005 Report Share Posted November 26, 2005 djmartins --> ja aizmirsies ; tad uzraada ka kljuudaina ir naakamaa koda rinda.... pie kljuudas vienmeer paarbaudi arii iepriekseejo/as rindas (koda blokus) no sintakses/neuzmaniibas kljuudam pasargaats nav neviens :( Link to comment Share on other sites More sharing options...
djmartins Posted November 26, 2005 Author Report Share Posted November 26, 2005 viss jau butu baigi kruta vienigi stelle ir tada ka vins rada tos 15 un taalak vins neizveido linkus uz nakamiem 15! Link to comment Share on other sites More sharing options...
Vebers Posted November 26, 2005 Report Share Posted November 26, 2005 tad uztaisi lai dala pa lapaam! $kopa_raksti = mysql_query("SELECT COUNT(*) FROM tabula"); $kopa_raksti = mysql_fetch_row($kopa_raksti); $kopa_raksti = $kopa_raksti[0]; $cik_lapas = ceil($kopa_raksti / $cik) /* izskaitljo cik lapas buus, jo dala visus ierakstus ar tik cik paradas lapaa */ if($cik_lapas > 0 AND ($lpp + 1) < $cik_lapas){ echo 'Taalaak'; } if($lpp > 0) { echo 'atpakalj'; } apmeeram taa Link to comment Share on other sites More sharing options...
Recommended Posts