NeoX Posted December 18, 2004 Report Share Posted December 18, 2004 Izstaastiet luudzu man latvieshu valodaa kaa iisti taa daliishana peec modulja straadaa. Nekaadi nevaru iebraukt!!! Lieta taada, ka es gribu gestbuku sadaliit pa lappuseem. Es kaut ko liidziigu esmu dariijis ieksh C++ ar to % operatoru, bet tagad esmu totaali aizmirsis. Domaaju, ka taa buutu ideaali sadaliit pa lappuseem. Protams var tur visaadi ar parastu daliishanu, bet kaa vareetu shaadi??? Link to comment Share on other sites More sharing options...
Kavacky Posted December 18, 2004 Report Share Posted December 18, 2004 $a % $b = atlikums dalot a ar b, piemēram 3 % 2 = 1. Link to comment Share on other sites More sharing options...
Roze Posted December 19, 2004 Report Share Posted December 19, 2004 Lai rekjinatu lapas parasti dara taa: $lapu_skaits = ceil($ieraksti_kopaa / $ieraksti_lapaa); Link to comment Share on other sites More sharing options...
TurboSasa Posted December 5, 2005 Report Share Posted December 5, 2005 kaa var realizeet linku uz katru lapu, ieraksti ir sadaliiti peec shaadas metodes: $lapu_skaits = ceil($ieraksti_kopaa / $ieraksti_lapaa); ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted December 5, 2005 Report Share Posted December 5, 2005 (edited) .... LIMIT sakums, kopaa piem ....LIMIT 5,10 sakt ar 5 ierakstu (to kas atbilst nosacijumiem) un raadit 10 gab (vai mazaak ja nav ko raadiit) edit: vispaar jau vareeji paskatiities arii sheit..... ierakstu dalīšana par lappusēm Edited December 5, 2005 by Grey_Wolf Link to comment Share on other sites More sharing options...
TurboSasa Posted December 6, 2005 Report Share Posted December 6, 2005 Tur taa daliishana pa lpp ir realizeeta SQL db bet man ir TXT faili. Varbuut kaads var paskaidrot vel reiz vai arii kodam salikt komentaarus kur kas daraas jo dazhas vietas es nesaprotu! Link to comment Share on other sites More sharing options...
php_Stopp Posted December 6, 2005 Report Share Posted December 6, 2005 (edited) no txt dokumentiem tāda vienkāršākā dalīšana: <?php $f = file('dati.txt'); $starts=(isset($_GET['starts']) ? $_GET['starts'] : 0); $beigas=(isset($_GET['beigas']) ? $_GET['beigas'] : 10); for($i=$starts;$i<$beigas;$i++) { echo $f[$i]; } echo '<a href="?starts='.($starts+10).'&beigas='.($beigas+10).'">10 vecāki ieraksti</a>"; ?> nu visas pārbaudes tur saliec pats, šitais tik tā.. primitīvs skelets Edited December 6, 2005 by php_Stopp Link to comment Share on other sites More sharing options...
Recommended Posts