btw neo you should use vBulletins database class this is just an example cause $ups will have the value as you now know.
PHP Code:
$usdbamt_query = $DB_site->query_first("SELECT varname FROM setting WHERE varname='ups'");
$userssearchamt = $usdbamt_query[0];
this allows you to have nice error reporting, just you will have to remember to globalize $DB_site in any function which accesses the database.