To tell your script which database to connect to do the following.
At the beginning of your file add:
Code:
include('config.php');
Then make a file called config.php while looks like this. (assuming your vb database is mysql)
Code:
<?
$dbuser = "your database username";
$dbpass = "your database password";
$db = mysql_connect("localhost", $dbuser, $dbpass);
$dbname = "name of your database";
?>
Hope this helps