Hello!

I am just getting going with OO stuff and I am stumped at how to pull
out query results once it is part of a class. I am also using PEAR. Here
is my code:

class user
{
var $retval;

function get_signin()
{
global $db_obj;
$DateView = date("Y-m-d");
        
$sql = "SELECT date_format(sys_time_sign_in, '%h:%i %p') as sign_in FROM
system_log WHERE sys_time_user_id='$_SESSION[valid_user]' AND
sys_time_date='$DateView' AND sys_time_flag='ON'";

$result = $db_obj->query($sql);
if (DB::isError($result)) 
        die($result->getMessage());     
                
while($rows = $db_obj->fetchRow($result, DB_FETCHMODE_ASSOC))
{
$retval[] = $rows;
}
$retval = Array();
$retval['signin'] = $signin;
return $retval;
}

} 


/*
now to try to get at the var $retval
*/


$userinfo = new user();
echo $userinfo->get_signin();


It just returns "Array"? How do I, for lack of a better word....get to
this array? Outside of a class it works great, I echo $rows['sign_in']
and it works. But this! Help!

Many many thanks!

Cory

-- 
Cory Hicks <[EMAIL PROTECTED]>
TRI-International


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to