Originally Posted by Fou-Lu
I'm not saying it won't work, I'm saying you're doing more work than you need.
There is no reason to convert to a string prior to checking the count.
Because you apparently can't use the IN keyword with Prepared Statements with any amount of ease, this no longer applies, because I am going back to my Looping approach.
I'm not sure why you are passing a msgArray on top of a selectedMsgArray; if you are updating all do you really need the msgArray? Maybe its for a pagination option so you only update a page at a time (which is fine)?
I want it so if the User checks the Top Check-Box, then whatever "action" they choose will apply to all Messages. In order to make that happen, I need to do this...
echo "<input name='msgArray[" . str2htmlentities($pmID) . "]' type='hidden' value=1 />";
That works great if you want to apply some "action" to everything, but I also need the ability for a User to cherry-pick the 1st, 3rd, 5th, and 6th Messages and have the "action" apply to just those selected ones. For that I chose to store things in a separate array. probably not the most efficient, but I have been screwing with this script for the last 3 weeks, and I need to get it done, so that is what I went with.
Feel free to offer a better approach - without JS - if you want!