getting data from inside a class
| From: | Cory Hicks | Date: | Fri, 27 Jun 2003 20:25:03 +0000 |
| Subject: | getting data from inside a class | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6298@lists.php.net to get a copy of this message | ||
Hey folks!
Can someone point me in the right direction with this little piece of
code. This all works fine to get $num_rows but I need to get at the
actual elements in the array....like $rows["sys_id"] ...how would I do
this? Do I return $results[] or $rows? It seem when I have tried this,
all I get returned is "Array"...
Any help would be great!
Thanks,
Cory
class user_info
{
var $num_rows;
function get_user_ts_info()
{
global $db_obj;
$sql = "SELECT sys_id, sys_time_user_id, sys_time_flag
FROM system_log
WHERE sys_time_flag = 'On'
ORDER BY sys_time_sign_in DESC";
$result=$db_obj->query($sql);
if (DB::isError($result))
die($result->getMessage());
while ($rows = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
$results[] = $rows;
}
$num_rows = $result->numRows();
return $num_rows;
}
}
--
Cory Hicks <chicks@tri-intl.com>
TRI International