I am using the PDO class to connect the database but in this particular situation I do not know how to use the PDO because in the mysql_fetch parameter I need to put a variable and for what I researched with the class PDO it is not the same way.
public function retornaDados($tipo=NULL){
switch(strtolower($tipo)){
case "array":
return mysql_fetch_array();
break;
case "assoc";
return mysql_fetch_assoc();
break;
case "object":
return mysql_fetch_object();
break;
default:
return mysql_fetch_object()
break;
}
}