Ancora niente...ho sbagliato a posizionarlo?

Codice PHP:
$i 1;
        while (
$row mysql_fetch_assoc($result)) {
            
$c '';
            
            foreach(
$row as $key=>$field) {
            
$c .= $this->bfm($key$field);
            }
            
$r .= sprintf($this->tr$cr $odd $even $c);
            
$cr $cr;
                
$i++;

        }
        return 
$r;
                return 
$i;
        } 

function 
bfm($fname$fvalue$i) {
    return 
sprintf($this->td$i$fvalue);
    }