Devils666 Posted December 31, 2009 Report Share Posted December 31, 2009 atkal es, ar savam problēmām :D skatījos google.lv, gan te foruma, varbūt nepareizi meklēju... bet nu kā var numurēt izvadīto informāciju... piemēram datubaze ID ir (kam tur, piemēram, exist=yes) 3,5,8,12,57,345 izvadot lai rādās(jeb sanumurējot) 1,2,3,4,5,6 kā kaut ko tādu var dabūt gatavu? Quote Link to comment Share on other sites More sharing options...
waplet Posted December 31, 2009 Report Share Posted December 31, 2009 (edited) var ... $i = 1; while($row = mysql_fetch_object($query)){ print "#".$i." ".$row->text; $i++; } Edited December 31, 2009 by waplet Quote Link to comment Share on other sites More sharing options...
briedis Posted December 31, 2009 Report Share Posted December 31, 2009 (edited) Nu kā, ciklā kur tu vadi ārā, vienkārši pieliec counterīti... $id = 0; while($row = mysql_fetch_ass..){ $id++; echo "ID: $id"; } ..atkal kāds pasteidzās :D Edited December 31, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
Devils666 Posted December 31, 2009 Author Report Share Posted December 31, 2009 (edited) jā, paldies, viss strāda, tieši kā bija domāts :) nedomaju, ka TIK atri dabūšu atbildi :D Edited December 31, 2009 by Devils666 Quote Link to comment Share on other sites More sharing options...
briedis Posted December 31, 2009 Report Share Posted December 31, 2009 Vispār jau šito tev pašam vajadzēja izdomāt... Quote Link to comment Share on other sites More sharing options...
Devils666 Posted December 31, 2009 Author Report Share Posted December 31, 2009 Nu jā, es zinu, man ar tiem $i līdz šim nebija skaidrs, ka vini darbojas, tagad saprotu... daudz kur noderes :P Quote Link to comment Share on other sites More sharing options...
briedis Posted December 31, 2009 Report Share Posted December 31, 2009 Nu jā, es zinu, man ar tiem $i līdz šim nebija skaidrs, ka vini darbojas, tagad saprotu... daudz kur noderes :P Tam nav nekāda sakara ar $i, bet gan tā ir vienkārša mainīgā skaitīšana... Quote Link to comment Share on other sites More sharing options...
Devils666 Posted December 31, 2009 Author Report Share Posted December 31, 2009 (edited) Tam nav nekāda sakara ar $i, bet gan tā ir vienkārša mainīgā skaitīšana... to es zinu, vienkārši to es kā piemēru, tur jau var kaut vai $mainigais, vienkārši viesbiežak tāda tip funkciju sanāk redzēt apzīmētu ar $i un garāku nemaz nav vērts rakstīt :P Edited December 31, 2009 by Devils666 Quote Link to comment Share on other sites More sharing options...
marcis Posted December 31, 2009 Report Share Posted December 31, 2009 Vēl vari lietot arī ol+li (html). Tiesa, šis nebūs īstais variants, ja ierakstus dala lappusēs. P.S. $id = 0; while($row = mysql_fetch_ass..){ echo ++$id; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.