Well, if you pre-define the sql, it should work.
$sql = "SELECT * FROM this WHERE filename ='".doInfo(filename)."'"
## Then run the query ##
$res = mysql_query($sql);
The value $sql is a standard string, and the function (depending on how it's made) will return a value in the string, then run the string as a query.
knutm