I am trying to use a returned string from my function 'get_setting' inside my class name 'settings'. I wanna use the returned string for the variable 'top_banner'. When I try using the '$this' variable to access the function, it does not work.
class settings{
function get_setting($name, $return="value"){
$query = mysql_query("SELECT * FROM website_settings WHERE name='".$name."'");
$row = mysql_fetch_array($query);
if($row['active'] == false){//This is turned off
return "disabled";
}else{//this setting is active
return $row['value'];
}
}
//Values
public $top_banner = $this->get_setting("top_banner");
}