too long

I have a model and a function in it as :

public function getAzad() {

    $db =JFactory::getDBO(); 
    $query_Recordset2 = "SELECT * from tablename where ag_fname = **"$ ??"** ";
$db->setQuery($query_Recordset2);
return $db->loadAssocList(); 

}

and there is a default.php in my view as :

$result2=$this->get('Azad');   
foreach ( $result2 as $row_Recordset2 )
{
<td> <?php echo $row_Recordset2['ag_azad'] ;</td>

I want to send a parameter to the function and in my query I want to check whether the record fname is equal to it or not. How can I send the parameter and how can I get the parameter and how can I use it in the middle of query?