Drupal Database Table Variable

In my previous post, Problem with Gallery Module for Drupal, I mentioned my need to modify data in the Drupal database table "variable". I learned the hard way the significants of the metadata contained in this table.

The table "variable" has two columns: name and value. The value field contains metadata indicating the type of data contained in the field. In my case gallery_embed_uri was:

s:26:"/test1/index.php?q=gallery";

The s:26 means string with a length of 26. So when I changed "test1" to "blog", I needed to also change "s:26" to "s:25" reflecting the shorter string length. Not doing so caused Drupal to fail in spectacular ways without good error messages.

I'm sure there is a reason for storing the length with the string value in the database, but I have not been able to find it online.

Other metadata types are outlined after the jump.

The metadata I have in my "variable" table is:


Array

a:<size>:{<data>};
a:1:{i:0;s:6:"status";}

Boolean

b:<value>;
b:1;

Integer

i:<value>;
i:1003;

String

s:<length>:"<string>";
s:25:"/blog/index.php?q=gallery";

Unknown

d:<value>;
d:1;

Submitted by steven on Tue, 04/01/2008 - 02:52. categories [ ]