Ok I wrote a useronline class and everything is working except the function that builds the list of Username and IP Address.
Here is the snippit
function uo_names() {
$query = "SELECT * from online";
$result = $this->_DB->get_results($query);
$uo_users = array();
foreach ($result as $res) {
$uo_users[$res['username']] = $res['ipaddr'];
}
return $uo_users;
}
This results in
"Fatal error: Cannot use object of type stdClass as array in /opt/lampp/htdocs/ibanc/includes/classes/class.useronline.php on line 76"
Line 76 is this: $uo_users[$res['username']] = $res['ipaddr'];
I have googled away but all I have seen is issues with commercial software. I do I build this array inside my class?? My Dev server is running Xampp which is PHP5 is this the problem??
Thx for any help
Eric