just when i knew how to deal with data connections to mysql, i just wanted to echo a simple data from 1 column by specific id, for now i just wanted to show the id as a test, but its really confusing why its giving me this error.
action controller:
public function actionTest()
{
$id = 2;
$peticion = Peticion::model()->findByPk($id);
$cotizacion = null; //Cotizacion::model()->findByPk($peticion->cotizacion_id);
$decreto = null; //Decreto::model()->findByPk($peticion->decreto_id);
$tipos = null; //Tipos::model()->findByPk($peticion->tipos_id);
$caracterizacion = null; //Caracterizacion::model()->findByPk($peticion->caracterizacion_id);
$this->render('test', array(
'peticion'=>$peticion,
'cotizacion'=>$cotizacion,
'decreto'=>$decreto,
'tipos'=>$tipos,
'caracterizacion'=>$caracterizacion,
));
}
the view:
<h1>Testing Vars..</h1>
<?php
echo $peticion->id;
?>
i just wanted it to show me the id of this table column, no relations are needed for this call cause its just trying to get gathered from the same table, i really dont see what im making this wrong.