Create a DB NPC named
Test.
PHP Code:
Test.foo = "bar";
echo(Test.foo); // echoes bar
you can right-click the DBNPC and choose "Edit Flags" to see what data is stored in it.
If you're having trouble with DBNPC flags resetting or rolling back (I haven't experienced this in the past few years, but I seldom use DBNPCs for data storage anymore), use:
PHP Code:
Test.trigger("update");
This should force it to save.
Keep in mind that you can only access DBNPC data from serverside.