Hey folks! I just posted this over on the PEAR list, but thought someone here might have some input. Can someone point me in the right direction with this little piece of code. This all works fine to get $num_rows or a single element in an array, but I need to get at all the actual elements in the array....like $rows["sys_id"] ...how would I do this? Do I return $results[] or $rows? It seems when I have tried this, all I get returned is "Array"...
Any help would be great! Thanks, Cory class user_info { var $num_rows; var $results; function get_user_info() { global $db_obj; $sql = "SELECT sys_id, sys_time_user_id, sys_time_flag, sys_time_sign_in, sys_remote_add, sys_user_agent 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()); /* //works to return num_rows while ($rows = $result->fetchRow(DB_FETCHMODE_ASSOC)) { $this->results[] = $rows; } //$num_rows = $result->numRows(); return $num_rows; */ //works to return 1 value $rows = $result->fetchRow(DB_FETCHMODE_ASSOC); $this->results = $rows[sys_time_user_id]; return $this->results; } } -- Cory Hicks <[EMAIL PROTECTED]> TRI International -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php