call another class's function inside a class

karabasan

New Member
Hello therei have 2 classes [*]for DB [*]for language i want to use my language things in the DBso it outputs the resultex :\[code\]class db_control{ var $db_connection, $lang_var; //create the function for the connection function db_connect(){ //define some variables global $db_host, $db_username, $db_password, $db_name, $lang_var; $this->db_connection = mysql_connect("$db_host","$db_username","$db_password")or die("can't connect to server with these informations"); //checl that the connection is established if($this->db_connection){ echo $lang_vars->getvar("$langvals[lang_con_est]"); }\[/code\]but this\[code\]$lang_vars->getvar("$langvals[lang_con_est]");\[/code\]doesn't worki mean it outputs many problemsand am sure my problem is that i didn't define my variables and classes correctlyP.S : the language class is in file called language.php and this part is in DB.MySQL.phpEDIT : this is the language class\[code\]class lang_vars{ public static function getvar($variable){ return $variable; }}\[/code\]i want the DB class to display text from the language classthats why i used \[code\] echo $lang_vars->getvar("$langvals[lang_con_est]");\[/code\]but it doesn't workcuz when i declare the language class$lang_vars = new lang_vars;inside the db_control it shows error unexpected T_something expected T_Functionand when i declare it outside nothing uphope i made things more clear now
 
Back
Top