anonīms Posted August 19, 2010 Report Share Posted August 19, 2010 Patreizējais kods: http://paste.php.lv/148295fc55192d1eb80b88490d52ce67?lang=php Ir nepieciešams aizstāt foreach ar while, jo vajag izmantot while($kkas <= 6) Pagaidām, kad arrayā ir 6 dati, tad viss okey, bet ir nepieciešams vēl nenoteikts skaits, kas nozīmē, ka vajag kodu, kas izvelk tikai 6 kartes. Kā to panākt? Quote Link to comment Share on other sites More sharing options...
Maris-S Posted August 19, 2010 Report Share Posted August 19, 2010 (edited) Laikam īsti nesapratu ko jāpanāk, bet foreach arī var pārtraukt jebkurā laikā ar break, bet ja ļoti vajag while var izmantot kaut vai funkcijas: reset, current, next. Edited August 19, 2010 by Maris-S Quote Link to comment Share on other sites More sharing options...
briedis Posted August 19, 2010 Report Share Posted August 19, 2010 (edited) Pirmkārt, stulbi ir saukt 6 kvērijus no vietas, ja to var izdarīt ar vienu piegājienu. INSERT INTO table1(col1, col2, col3) VALUES (val1, val2, val3), (val4, val5, val6), ...... Otrkārt for($i=0;$i<6;$i++){ echo $arr[$i]; } Edited August 19, 2010 by briedis 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.