Народ! Срочно нужна помосчь! Пытаюсь сам разобраться в OOP PHP. Написал небольшой класс и сценарий, который его юзает. Вылетает ошибка вообще тупейшая - "Fatal error: Call to undefined function setTableFields() in ...." вот код класса: PHP: <?php //class DBapplication class DBapplication { //-----------------------Opredel9em peremennie---------------------------------------- //$db_const = file("./admin/db_const.yax"); //host, login, pass, defDB, defTable public $db_const = array("localhost", "andrex", "master", "users", "user_info"); private $_DBhost, $_DBuserLogin, $_DBuserPass, $_DBdefaultDataBase, $_DBdefaultTableName; private $_DBlink; private $_tableFields; private $_user_info; //-----------------------Opredel9em massiv poley tablici SQL------------------------ public function setTableFields() { DB_connect(); $result = mysql_list_fields(getDBDefaultDataBase(), getDBDefaultTableName(), $this->DBlink); $count = mysql_num_fields($result); for($i=0; $i<$count; $i++) { $this->_tableFields[mysql_field_name($result, $i)] = null; } } //----------------------peremennie na connect DB --------------------------------------- //---------------------------Host------------------------------------- public function getDBhost() { return $this->_DBhost; } public function setDBhost() { $this->_DBhost = $db_const[0]; } //------------------------- UserLogin------------------------------------ public function getDBuserLogin() { return $this->_DBuserLogin; } public function setDBuserLogin() { $this->_DBuserLogin = $db_const[1]; } //------------------------- UserPass------------------------------------ public function getDBuserPass() { return $this->_DBuserPass; } public function setDBuserPass() { $this->_DBuserPass = $db_const[2]; } //------------------------- Default DB------------------------------------ public function getDBdefaultDataBase() { return $this->_DBdefaultDataBase; } public function setDBdefaultDataBase() { $this->_DBdefaultDataBase = $db_const[3]; } //-------------------------------Default table-------------------------- public function getDBdefaultTableName() { return $this->_DBdefaultTableName; } public function setDBdefaultTableName() { $this->_DBdefaultTableName = $db_const[4]; } //-------------------------------------------------------------------------------- public function DB_connect() { $id = mysql_connect($this->_DBhost, $this->_DBuserLogin, $this->_DBuserPass); if(!$id) throw new Exception("Error data base connecting"); $this->_DBlink = $id; return $this->_DBlink; } //------------------------------------------------------------------------------------ //-----------------------------------Functions & constructor-------------------------- public function __construct($field_name, $field_value) { setTableFields(); if(array_key_exists($field_name, $this->_tableFields)) { $q1 = mysql_query("SELECT * FROM $this->_tableFields['getDBDefaultTableName()'] WHERE $field_name='$field_value'"); while($q2 = mysql_fetch_assoc($q1)) { $j = 0; for($i=0; $i<count($q2); $i++) { $base_values[$j][] = $q2[$i]; $j++; } } if(!is_null($base_values[0][0])) for($i=0; $i<count($base_values[0]); $i++) $this->_user_info[] = $base_values[0][$i]; } } //--------------------------------View user information------------------------ public function view_info() { for($i=0; $i<count($this->_user_info); $i++) echo $this->_tableFields[$i]." - ".$this->_user_info[$i]."<br />"; } //------------------------------------------------------------------------------------ public function __get($fieldName) { if(!array_key_exists($fieldName, $this->_tableFields)) throw new Exception('Invalid properties value'); if(method_exists($this, 'get'.$fieldName)) { return call_user_func(array($this, 'get'.$fieldName)); } else { return $this->_tableFields[$fieldName]; } } public function __set($fieldName, $fieldValue) { if(!array_key_exists($fieldName, $this->_tableFields)) throw new Exception('Invalid properties value'); if(method_exists($this, 'set'.$fieldName)) { return call_user_func(array($this, 'set'.$fieldName)); } else { $this->_tableFields[$fieldName] = $fieldValue; } } //------------------------------------------------------------------------------------ } ?> и сценрия: PHP: <?php include 'class.DBapplication.php'; $f_name = $_POST['fieldName']; $f_value = $_POST['fieldValue']; $info = new DBapplication($f_name, $f_value); $info->view_info(); ?> Помогите плиз!