我是 php 的初学者。我有这个 Sql 问题:
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;
}
显示的错误是: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
在这一行$result = mysql_query($qry,$this->connection);
。
问题是什么?我该如何解决?