Reebo makes sense here, rather than describing how you are addressing a requirement, why not state what the requirement is and see if someone has another approach.
Arrays probably aren't the best approach to comparing data.
I have a report that pulls customer information. Each customer has a unique ID number.
Each year, we generate a list of customers to whom we send a promotional discount. This list changes yearly and is sent to 10-15 customers per year. Among other things, this report shows what we charge each customer, based on a formula in the report. If they are one of the customers that are being offered a discount, we calculate their price differently.
So instead of hard-coding who is getting the discount into the report and having to change the report yearly, we just store the new information in the database. Then, we can just compare the report to the table to see who was offered the discount.
So I thought the best way to do this was to pull the table into an array and compare each customer to this array to adjust the way their price gets calculated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.