Uldeens Posted October 5, 2006 Report Share Posted October 5, 2006 (edited) <? for($i=1;$i>40; $i++) { echo $i; } ?> $i mainigais var mainities. Kā panākt lai pēc katriem 10 izdrukatiem cipariem tiek ielikts <br/> un nākamie pārnesti jaunā rindā. Edited October 5, 2006 by Uldeens Link to comment Share on other sites More sharing options...
Grey_Wolf Posted October 5, 2006 Report Share Posted October 5, 2006 (edited) var shadi (nav optimalakais) <?php $a=0; for($i=1;$i>40; $i++) { echo $i; $a++; if( ($a%10)==0 ) { echo '<br />'; } } ?> Edited October 5, 2006 by Grey_Wolf Link to comment Share on other sites More sharing options...
v3rb0 Posted October 5, 2006 Report Share Posted October 5, 2006 ja $i var mainīties, tad jau neko daudz optimālāk nevarēs laikam.. $a = 10; for($i=99;$i>40; $i--) { echo $i.'; '; if(--$a == 0) { echo '<br />'; $a = 10; } } Link to comment Share on other sites More sharing options...
Uldeens Posted October 5, 2006 Author Report Share Posted October 5, 2006 Njaa palides straadaa. Bet sapratu ka man tas isti neder... Bija domāts tipa contentu no DB daliit pa lapaam. Bet pa daudz rezultatu. Jataisa kautkaa savadak. Link to comment Share on other sites More sharing options...
usver Posted October 5, 2006 Report Share Posted October 5, 2006 (edited) for($i=1; $i>40; $i++){ echo $i; } tev neizpildās nekas, jo cikla nosacījums ir aplams. šitā sanāks: for ($i = 0; $i < 40; $i++){ echo $i.' '; if ( $i and !(($i + 1) % 10)){ echo '<br>'; } } Edited October 5, 2006 by usver Link to comment Share on other sites More sharing options...
Uldeens Posted October 5, 2006 Author Report Share Posted October 5, 2006 To es pamaniju. Bet tapat man tas neder jo ir 100tiem ieraxtu. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted October 6, 2006 Report Share Posted October 6, 2006 Bet sapratu ka man tas isti neder... Bija domāts tipa contentu no DB daliit pa lapaam. Pag pats nepareizi noformuleeji savu jaut ;) Taa arii vajadzeeja pajautaat Kaa sadaliit DB ierakstus pa lapaam... Pavisam cits algoritms: 1. atceries ka DB ir operators LIMIT no,skaits (LIMIT 0,10) !!! 2. noskaidro cik ierakstu vispar buus (teiksim 99) 3. uzini cik lapu buus kopaa. (tiiraa matimatika) 4. caur GET padod nepiecieshamo lapu (izvadi lapu numurus ar linkiem teiksim mana.php?lapuse=1; utt 5. nolasi GET un izveido atbilstoshu LIMIT dalju (kaa atsevikju mainiigo) $limitc="LIMIT no_kura_ieraksta_lasiit , Cik_attelot_vienaa_lapaa_max_skaits"; 6. piekabini vinju savam SQL pieprasijumam $query="SELECT * FROM tabulis $limitc"; 7. veic sql pieprasijumu ... ------------------------------------------------------ taada apmeram ir logjika Link to comment Share on other sites More sharing options...
andrisp Posted October 6, 2006 Report Share Posted October 6, 2006 Grey_Wolf, deram, ja viņš būtu pa tiešo pareizi noformulējis jautājumu, tu viņam pateiktu, ka tas jau te ir 50 reizes apspriests, un pasūtītu piecas mājas tālāk. :) Link to comment Share on other sites More sharing options...
Uldeens Posted October 6, 2006 Author Report Share Posted October 6, 2006 Nee Grey Wolf man jau izveidots viss ta ka ieraksti sadalaas pa 9gb lapaa un var leekat pa lapaam viss oki. Bet man ir daudz ierakstu. Meeginaju uztaisiit lai tipa paraada kadus no 1 - 10 un tad next bet nesanaca. Tad izdomaaju vismaz tipa lai stabinaa tie lapu linki butu nevis rinda tada ka jaascrollo :) Link to comment Share on other sites More sharing options...
alins Posted October 6, 2006 Report Share Posted October 6, 2006 varbuut ir kas deriigs -> http://php.lv/f/index.php?showtopic=2881 Link to comment Share on other sites More sharing options...
Recommended Posts