PHP Foreach Loop Issue...

Posted by Calibur747, 02-12-2011, 05:09 PM
Hello WHT, I am having an issue where some users are not having an invoice created when this script runs. The gist of the system is that the user can charge items to their account all month long and then on the 1st of the next month, have all the previous months pending charges (balancepending) become balance due (balancedue). We add $2 to the balance due for our fee and then create an invoice. Now, I am selecting all users and going through them in a foreach loop for an array. Randomly however some are not being included in the invoice creation process, and still have their balancepending and no balancedue ( aka it's like the whole script skipped a few random accounts ). Can anyone see an error or lapse in the code? Thank you for the assist.

Posted by Hostify Networks, 02-12-2011, 07:21 PM
I've cleaned up the code for you:

Posted by Calibur747, 02-12-2011, 09:55 PM
Thank you kindly, do you think this will minimize the chance of accounts being skipped? Definitely looks a lot cleaner

Posted by Hostify Networks, 02-12-2011, 10:12 PM
Accounts won't be skipped (unless the script times out...adding set_time_limit(0) to the top of the script will fix that). Test it first before adding to the live site, of course.

Bu cevap yeterince yardımcı oldu mu?

 Bu dökümanı yazdır

Also Read

Opinion about Xen

Posted by copahost, 09-14-2008, 06:51 PMI have read many topics here about Xen vs Virtuozzo vs...

header already sent?

Posted by Calibaba, 03-27-2008, 12:00 PMPHP Warning: Cannot modify header information - headers...

Bizarre problem with sending/receiving emails in Outlook 2007

Posted by Azam_net, 01-11-2008, 03:46 PMThere is a strange problem with picking up and sending...

looking for creditcard processing international

Posted by zhai, 09-05-2001, 07:36 PMi'm nearly decide to use service from revecom.com but after...

LINUX BASH : keep the order in STD* output tunnels

Posted by Mister Bark, 10-31-2012, 11:17 AMHi! This will make a file "test" : ... and not :...