Yo!
Please read Phanx' post about saved variables
here. You can also find some useful info on SVs on
wowpedia, that article explains quite well what's going on there.
Then you can check
this and
this code by Phanx, those are two nice examples of how to read data from and write data into SV table.
It's 5am at my place, so I'm helluva tired, sorry, but can't help you now. If no one helps you by the time I wake up tomorrow, I'll try to explain things and provide some examples.
Good night.