I have a webpage that inserts array values into a database based on the criteria that the value in one of the fields is not equal to zero. So I have:
YearArray: 2014, 2015, 2016
AmountArray: 100,0,0
The insert will only insert a single record with the 2014 and the 100 into the table.
Now the process has changed and the user wants to be able to insert a record where there is a zero in one of the array positions something like:
YearArray: 2014, 2015, 2016
AmountArray: 0,,
So I am thinking that I would want to test for not equal to "", but I am having difficulty. Do I need a separate if evaluation or do I want to have a compound evaluation of if not equal to zero OR not equal to ""? I am not sure of the placement whether I should evaluate for the "" before the 0 or after the 0 evaluation.
Also if the user has this array, how do I ensure that the right position of the array is inserted into the database if the data was:
YearArray: 2014, 2015, 2016
AmountArray: ,0,
Thank you for any help that you can provide. I can provide the actual page code if it helps, there is just a lot more to the page that complicates it that I didn't think would help in answering this question.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.