Hi all!

I've noticed the content of 'data' field in the 'user' table, for example:

a:3:{s:6:"submit";s:18:"Create new account";s:7:"form_id";s:13:"user_register";s:5:"block";a:1:{s:11:"syndication";a:1:{i:0;i:1;}}}

I don't understand the meaning of this string, the use of branches and, above all, the use of patterns like:
a:3
s:7

Anybody knows about that?

Comments

jsloan’s picture

From this post it seems that the data field is an experiment with the user table that has caught on... more to your question; the PHP function serialize() generates a storable representation of a value. A nice explanation is found in this article Using Serialized PHP with Yahoo! Web Services

Serialized PHP is a data encoding format for PHP. It is easy to store and transmit and is a convenient format for PHP developers to work with. It's built-in support in the PHP programming language makes it a good choice for PHP application developers.
decola’s picture

It seems you're right...pretty technique! I didn't know about it.

Thanks you so much :-)

Hayakawa’s picture

Thanks.

Do you know what are the practical applications of this "serialization"?

bsell5’s picture

I'd like to know what each component of 'data' represents so i can insert a record into 'users' table from a custom registration process

Thanx

jsloan’s picture

Review the function user_save() in user.module. You will see how the data field is unserialized into an array. You will want to look at that array for the fields.