Ehhhh, Dont see what this code is supposed to do, but it wont work with what you have
Code:
$db = mysql_connect($server,$username,$pass);
$query = "SELECT * FROM test";
$results = mysql_query($query);
while ($row = mysql_fetch_array($results) //<-This $result is getting overwritten by the following
{
$query = "SELECT * FROM test2";
$results = mysql_query($query); //<-SO simply change to something else, ie $result2
}