Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest huey4657

My parts won't grow?

Recommended Posts

Guest huey4657
Hi all,
Does anyone know how to increment a position within an array, these do not work:

Loop
$array[$cnt]++;
$array[$cnt] = $array[$cnt]++;

thks.

Share this post


Link to post
Share on other sites
haha sorry but your title made me laugh.

Anyways i dont get what youre trying to do...?

if youre just tryin to set new values you can just use something like

$array = array();
$array[] = "value1";
$array[] = "value2";
$array[] = "value3";
$array[] = "value4";

Then array[0] would be value1 [1] would be value2 and so on..........

Share this post


Link to post
Share on other sites
Guest huey4657
Hi,
Basically I have 3 arrays with 18 counters that need updating in a while loop of (max) 300000+ records, the 18 counters increment when there is a match of 1 or 2-3 or >3 (3 arrays) in one field and depending on the other field which = between 1 and 18 that counter increments. So if row 1, field 1 = 1 that be a position in an array, and field 2 = between 2 and 3, the (2-3) array increments in position 1.

And I would like anyhelp in how i can increment a part of an array

Hope this makes sense.

Thnks for any help

Share this post


Link to post
Share on other sites
Guest huey4657
Sorry, the problem wasn't the count it was the if(condition).

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.