R: [PHP-WIN] for loop...

From: Date: Fri, 08 Mar 2002 10:02:25 +0000
Subject: R: [PHP-WIN] for loop...
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-12517@lists.php.net to get a copy of this message
Hi Murphy this is a very dumb answer... you may test if Approve.length is equal to zero before the second loop, so you may change your code to for(int i = 0; i < View.length; i++) if(Approve.length==0) { do something } else { for(int l = 0; l <Approve.length ; l++) SQL = "insert into DOC_PRIVILEGES (COD)...... } } May be it an idea? Regards Darvin > -----Messaggio originale----- > Da: Sandeep Murphy [mailto:sandeep.murphy@oni.pt] > Inviato: venerdì 8 marzo 2002 10.44 > A: php-windows@lists.php.net > Oggetto: [PHP-WIN] for loop... > > > hi, > > may be this is a dumb question to ask but here goes anyway.. > > I have 2 for loops such as: > > for(int i = 0; i < View.length; i++) > for(int l = 0; l <Approve.length ; l++) > > SQL = "insert into DOC_PRIVILEGES (COD)...... > > } > } > > where view.length = 5 and approve.length is 0 (in this case), how do i > execute my query irrespective of whether the inner forloop is empty or > not??? > > I cannot use a l"<=" as it wud result in an ArrayOutOfBoundsException... > > any suggestions pl?? > > TIA, > sands > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.windows (#12517) next »