I'm looking to do something simple, but having a problem with not even knowing where to start. I want to have an array stored in a database. The php file accesses the first string in the array, deletes it, then adds a new string at the end of the array. Is this possible? Thanks in advance.
There was a similar question recently: http://forums.digitalpoint.com/showthread.php?t=448989 The answer to storing an array in a database is you should probably redesign your database, but if you have to, use serialize. (http://us2.php.net/manual/en/function.serialize.php)
Thank you very much for the help! Do you think it'd be easier if I just used a flat file system? I considered using a text file, but it might get up to 200 lines long or so. Would that bog down the server too much or do you think it'd be okay? Also, would there be any problems with a flat file system if multiple people loaded up the page?
Not particularly, you'd have to serialize to file instead of serializing to database. Not if they're just reading the file and not editing it. When you say "The php file accesses the first string in the array, deletes it, then adds a new string at the end of the array", do you mean that happens everytime someone looks at the php page? In that case a flat file system wouldn't be good without some sort of code to handle multiple opens at once. Can you provide a little more info?
Basically I want the user to "trade" in a string. 1. The page will give them a string from the array. 2. They "take" the string (click it) which causes it to delete itself. 3. They supply a new string that goes into the array.
Just an added note, it doesn't even have to be an array. I just need some kind of method for someone deleting a string "in line" then adding their own to the end of the "line".