The basic settings are all stored in the config.inc.php file. User specific settings would be stored in the w3t_Users table for that specific version and that's really about it.

If your config file keeps getting wiped out upon submission then it could be that the variables just aren't being submitted. This could be something like an misconfigured suhosin or something of that nature. If it's telling you that the settings were updated, it's trying to write out the updated config file, but the variables just aren't getting there.