I've read some of the other posts about this functionality and I'm just not getting it. So I'm going to post my own query.
I have a global array that I populate with information as the visitor takes the proper actions. Once they have completed their visit, I'd like to allow them to save that information to the database. But what I want to do is save all of the information from that array into 1 database column on 1 row entry.
What I'd like to do is take the array and using a ; between each value and a : at the end of the line, assemble it into a long string which I can then store in the database. I already have a function which will take that information in the result set, and break it apart into the array.
Then I can manpulate that array either adding to it, deleting from it or changing a value in it. I just can't seem to get the information into a string variable. Also, I can't seem to find out where to look to find the code that will let me do it.
Here's the code that breaks apart the result set into the array.
$theAttributes=split(":", $creatureData[creature_attributes]);
for( $i=0; $i < count($theAttributes) -1; $i++ )
{
$creatureAttributes[$i]=split(";", $theAttributes[$i]);
}
$creatureAttributes = array_values($creatureAttributes);
So I end up with an 2d array which I can then manipulate anyway I want. So now what I want to do is take that array, and put it back into a single string to put it back into the database.
I actually take the result set and put it into an object, but this will also function the same way.
Can anybody please help me?
Thanks in advance for any coding help.
Skunk