PDA

View Full Version : Database Node Lookups



drahkar
January 9th, 2010, 16:18
Ok, I'm running into a small wall. I need to lookup the current person's identity and then use that information to lookup the related database node so that i can update information under it. I can't seem to find enough information on this process.

If no one has the time think of the process, could someone at least point me to one of the lua files that has the information in it?

Thanks!

Valarian
January 9th, 2010, 16:43
If I remember rightly, User.getCurrentIdentity() will get the identity of the current person. then, I think, DB.findNode() to find it.

drahkar
January 9th, 2010, 18:37
I think I've almost figured it out. I'm pretty sure its supposed to be something like the following:


window.getDatabaseNode().getChild("strengthmax").setValue(100);

But in response I get an 'Attempt to index a nil value' error because that specific element is not saved in the database. Its purely a numbercontrol and is set by the data it's given. This is by design. Is there a way to reference to it for changing it's value without having to save it to the database?

drahkar
January 9th, 2010, 20:07
Nevermind. Gotten past that. Thanks for the help everyone.