Strange array data when trying to output data from database

Hi,

Has anyone ever got array data like this?

All I did is this:

In the site controller




     */

    public function actionIndex()

    {

   

 

	$sectionone=Sectionone::find(1);




        return $this->render('index', [

            'sectionone' => $sectionone,

            

        ]);

        

        

    }



My table is sectionone

and would like to output all the columns from that table. I tried multiple queries and same output each time.

In the index view:




   <a class="page-scroll" href="#LINK1"><?php var_dump($sectionone); ?></a>



Why would my query returns this please?

Thanks

It is not strange at all - it returns a query object.

Use ‘findOne’ instead of ‘find’ and access the fields like this:


<?= $sectionone->id ?>


<?= $sectionone->another_field ?>



http://www.yiiframework.com/doc-2.0/guide-db-active-record.html#querying-data

Thank you so much master Jacmoe ::).