class main{ public $FILEDIR = "d:/home/files"; function selfdump(){ print_r($this); } } require "factory/_dbh.php"; $m = new main(); $pdo = _dbh( $m, array('myweb') ); $sth = $pdo->prepare("SELECT * FROM forum WHERE mesgid=39"); $sth->execute(); $r = $sth->fetchObject('main'); $r->selfdump();