skrappy1979 Posted November 3, 2010 Share Posted November 3, 2010 I need to add a condition to a while() statement I have. It should run when $counter is less than the number of records in my $products array which has 5 products. I set $counter and $product_no to 0. I need to use the count() function to get the number of records. Does that make sense? Do ya'll need more info. Any help is Greatly appreciated. Ive referenced and searched but cant figure out how to incorporate it. Im still learning. Peace, Skrappy Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted November 3, 2010 Share Posted November 3, 2010 $products = array(); // your array here $recordCount = count($products); // count records $counter = 0; // set counter to zero $product_no = 0; // set product number to zero while($counter < $recordCount) { // do stuff? $counter++; } Quote Link to comment Share on other sites More sharing options...
skrappy1979 Posted November 3, 2010 Author Share Posted November 3, 2010 Awesome, Thx 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.