I got this error, i cant figure whats problem. My code is
class Example{
public function get_lang()
{
$jezik = get_option('jezik');
switch ($jezik ) {
case $jezik == 'rs_RS':
$drzava = 'NazivSrb';
break;
case $jezik == 'ro_RO':
$drzava = 'NazivRo';
break;
case $jezik == 'uk_UK':
$drzava = 'NazivRu';
break;
}
return $drzava;
}
static public function ExecuteSql($where_criteria=NULL) {
global $wpdb;
$drzva = $this->get_lang();
$upit = "
SELECT ID, Naziv, $drzava, PhoneCode, Kod
FROM wp_drzava";
if ($where_criteria)
$upit .=" WHERE ". $where_criteria ;
$upit .= " GROUP BY Kod";
//echo $upit;
return $wpdb->get_results($upit);
}
{
Basically I try to use get_lang method return value, and save it to variable in other method, and pass it to query. But i get an error in this line
$drzva = $this->get_lang();