SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,179
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)

    Help accessing part of array

    Heres my large amount of code... I need to know how to echo [_countrotected] which is 8 lines from the bottom of the code.

    Code:
    Zend_Db_Table_Rowset Object
    (
        [_data:protected] => Array
            (
                [0] => Array
                    (
                        [id] => 1
                        [owner] => kwolfe
                        [type] => Senior Photos
                        [date] => 2009-10-02
                    )
    
                [1] => Array
                    (
                        [id] => 2
                        [owner] => kwolfe
                        [type] => Misc. Session
                        [date] => 2009-10-22
                    )
    
            )
    
        [_table:protected] => Model_DbTable_Sessions Object
            (
                [_name:protected] => tblSessions
                [_definition:protected] => 
                [_definitionConfigName:protected] => 
                [_db:protected] => Zend_Db_Adapter_Pdo_Mysql Object
                    (
                        [_pdoType:protected] => mysql
                        [_numericDataTypes:protected] => Array
                            (
                                [0] => 0
                                [1] => 1
                                [2] => 2
                                [INT] => 0
                                [INTEGER] => 0
                                [MEDIUMINT] => 0
                                [SMALLINT] => 0
                                [TINYINT] => 0
                                [BIGINT] => 1
                                [SERIAL] => 1
                                [DEC] => 2
                                [DECIMAL] => 2
                                [DOUBLE] => 2
                                [DOUBLE PRECISION] => 2
                                [FIXED] => 2
                                [FLOAT] => 2
                            )
    
                        [_defaultStmtClass:protected] => Zend_Db_Statement_Pdo
                        [_config:protected] => Array
                            (
                                [host] => kylewolfe.info
                                [username] => kwolfe_kyle
                                [password] => xxxx
                                [dbname] => kwolfe_carleen
                                [charset] => 
                                [persistent] => 
                                [options] => Array
                                    (
                                        [caseFolding] => 0
                                        [autoQuoteIdentifiers] => 1
                                    )
    
                                [driver_options] => Array
                                    (
                                    )
    
                            )
    
                        [_fetchMode:protected] => 2
                        [_profiler:protected] => Zend_Db_Profiler Object
                            (
                                [_queryProfiles:protected] => Array
                                    (
                                    )
    
                                [_enabled:protected] => 
                                [_filterElapsedSecs:protected] => 
                                [_filterTypes:protected] => 
                            )
    
                        [_defaultProfilerClass:protected] => Zend_Db_Profiler
                        [_connection:protected] => PDO Object
                            (
                            )
    
                        [_caseFolding:protected] => 0
                        [_autoQuoteIdentifiers:protected] => 1
                        [_allowSerialization:protected] => 1
                        [_autoReconnectOnUnserialize:protected] => 
                    )
    
                [_schema:protected] => 
                [_cols:protected] => Array
                    (
                        [0] => id
                        [1] => owner
                        [2] => type
                        [3] => date
                    )
    
                [_primary:protected] => Array
                    (
                        [1] => id
                    )
    
                [_identity:protected] => 1
                [_sequence:protected] => 1
                [_metadata:protected] => Array
                    (
                        [id] => Array
                            (
                                [SCHEMA_NAME] => 
                                [TABLE_NAME] => tblSessions
                                [COLUMN_NAME] => id
                                [COLUMN_POSITION] => 1
                                [DATA_TYPE] => int
                                [DEFAULT] => 
                                [NULLABLE] => 
                                [LENGTH] => 
                                [SCALE] => 
                                [PRECISION] => 
                                [UNSIGNED] => 
                                [PRIMARY] => 1
                                [PRIMARY_POSITION] => 1
                                [IDENTITY] => 1
                            )
    
                        [owner] => Array
                            (
                                [SCHEMA_NAME] => 
                                [TABLE_NAME] => tblSessions
                                [COLUMN_NAME] => owner
                                [COLUMN_POSITION] => 2
                                [DATA_TYPE] => varchar
                                [DEFAULT] => 
                                [NULLABLE] => 
                                [LENGTH] => 128
                                [SCALE] => 
                                [PRECISION] => 
                                [UNSIGNED] => 
                                [PRIMARY] => 
                                [PRIMARY_POSITION] => 
                                [IDENTITY] => 
                            )
    
                        [type] => Array
                            (
                                [SCHEMA_NAME] => 
                                [TABLE_NAME] => tblSessions
                                [COLUMN_NAME] => type
                                [COLUMN_POSITION] => 3
                                [DATA_TYPE] => varchar
                                [DEFAULT] => 
                                [NULLABLE] => 
                                [LENGTH] => 255
                                [SCALE] => 
                                [PRECISION] => 
                                [UNSIGNED] => 
                                [PRIMARY] => 
                                [PRIMARY_POSITION] => 
                                [IDENTITY] => 
                            )
    
                        [date] => Array
                            (
                                [SCHEMA_NAME] => 
                                [TABLE_NAME] => tblSessions
                                [COLUMN_NAME] => date
                                [COLUMN_POSITION] => 4
                                [DATA_TYPE] => date
                                [DEFAULT] => 
                                [NULLABLE] => 
                                [LENGTH] => 
                                [SCALE] => 
                                [PRECISION] => 
                                [UNSIGNED] => 
                                [PRIMARY] => 
                                [PRIMARY_POSITION] => 
                                [IDENTITY] => 
                            )
    
                    )
    
                [_metadataCache:protected] => 
                [_metadataCacheInClass:protected] => 1
                [_rowClass:protected] => Zend_Db_Table_Row
                [_rowsetClass:protected] => Zend_Db_Table_Rowset
                [_referenceMap:protected] => Array
                    (
                    )
    
                [_dependentTables:protected] => Array
                    (
                    )
    
                [_defaultSource:protected] => defaultNone
                [_defaultValues:protected] => Array
                    (
                    )
    
            )
    
        [_connected:protected] => 1
        [_tableClass:protected] => Model_DbTable_Sessions
        [_rowClass:protected] => Zend_Db_Table_Row
        [_pointer:protected] => 0
        [_count:protected] => 2
        [_rows:protected] => Array
            (
            )
    
        [_stored:protected] => 1
        [_readOnly:protected] => 
    )

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,179
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Additionally, this is obviously part of the Zend framework. Im using the DbTable method to connect and display data. In order to echo a column in a view I state: echo $this->escape($user->username); How might I echo this in the controller right after I make the db connection?

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use count() on the object.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dude im at a lost... reduce the amount of code.. and explain what u mean...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •