Quote:
Originally Posted by doubledee
Where the problem exists is that while I can populate some array with all 50 PM's when my script first runs (e.g. $testArray), when the user submits the Form, any values in my array get erased.
|
Thats because the script has stopped running and it's variables are lost (thats the way PHP works I'm afraid - not the same as a windows program). When you submit the form the script runs as a fresh instance with its own memory and variables. Thats the way PHP works and why most people use sessions between scripts being executed to store temporary memory.
Quote:
Originally Posted by doubledee
So I figured that if I could pass the entire array back via the $_POST array, then I could continue to use $testArray, and use all 50 values in it to run my UPDATE and thus mark all 50 PM's as "Unread", if you follow me?!
|
Yes I've followed that all along and yes there is nothing wrong with doing it that way if thats the way you're happy with it. We've shown you several suitable ways for you to achieve that, it's just a case of you picking what you think is best for you.
Quote:
Originally Posted by AndrewGSW
I assume you are referring to JS stringify() and parse()?
|
No I was talking about the php functions. I don't do front end design or javascript
Quote:
Originally Posted by AndrewGSW
Serializing in PHP is intended to serialize objects..?
|
Actually I wasn't aware that you could serialize objects. As far as I was aware it only applied to variables such as arrays, strings, numbers etc so thats news to me!