php函数中的MySQL-Link错误

i am beginner in php . and i have this Sql problem:

function InsertUserBirdsFromFile($File_content){
for($i =0; $i < count($File_content); $i+=2){
$id = $this->Master_file($File_content[$i], $File_content[$i + 1] );
if(isset($id)){
try{
$qry = "insert into user_to_birds(user_id,tax_id)values( 1 ,'.$id .') ";
         $result = mysql_query($qry,$this->connection);

}
catch(Exception $ex){ echo  $ex;}
}
}
}

function Master_file($name, $latin ){
try{

 $qry = "SELECT tax_id FROM  master where name =".$name." and latin =".$latin;
         $result = mysql_query($qry,$this->connection);
        }
        catch(Exception $ex){ return null;}
                        if ($result == true && mysql_num_rows($result) >0) {
                        $p=0;
                          while ($Res_user = mysql_fetch_array($result) ) {
                        $marques[$p] = $Res_user;
                        $p++;
                        }
                        return $marques[0]['tax_id'];
                        }
                        else return null;
}

the error shown is : Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/admin/public_html/hitlist/include/fg_membersite.php on line 427 in this line $result = mysql_query($qry,$this->connection);.

what is the problem? How can i fix it?

Well, maybe unrelated but i think this needs to be fixed

$qry = "insert into user_to_birds(user_id,tax_id)values( 1 ,'.$id .') "

to

$qry = "insert into user_to_birds(user_id,tax_id)values( 1 ,".$id .") "

or

$qry = "insert into user_to_birds(user_id,tax_id)values( 1 ,$id) "