PDA

View Full Version : Looking at the datastore ...


cinq
02-05-2005, 09:44 AM
I don't quite get it.

I was looking at how vb stores her vboptions, seems to serialize it and throws it into the datastore. Is the datastore table just what the name implies, a table to store data ?


a:300:{s:15:"templateversion";s:5:"3.0.5";


A short starting fragment from the options row in datastore shows this.
What does the a, s etc. mean ?

I am trying to find a way to utilize the datastore to hold my hack options similar to the way vb does it.
Please help explain it to me, thanks ! :)

Hmm.. ok the a:300 apparently is the number of elements ?

Dean C
02-05-2005, 09:52 AM
The datastore table holds arrays in a string format

http://uk2.php.net/serialize

Take a look at the explanation there, all you have to do is build your array and serialize it and it'll become a string. Then you pull the string back out the database again and unserialize it. It magically becomes an array again :)

cinq
02-05-2005, 09:56 AM
Yep Dean, I remember you tried to tell me to use it previously for caching :)
I did read up about serialize ( and unserialize ) back then :D

But what does the s mean ?

Oh nvm, I found that out here (https://vborg.vbsupport.ru/showpost.php?p=576033&postcount=8) :D
Thanks again Dean :)