Yii Framework Forum: Error When Use Find Method. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Error When Use Find Method. Error when use find method. Rate Topic: -----

#1 User is offline   sergiolinares 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-March 14

Posted 26 May 2014 - 08:25 AM

Hello,
i have Cursos.php, Grupovalores.php and Grupovaloresdetalle.php

In the class Cursos.php i have then traerDescripcionTipoCurso method, this method produce an error when:

public function traerDescripcionTipoCurso()
{
(1)$IdGrupo = Grupovalores::model()->find(array('condition'=>"Codigo_ID_Grupo='TIPO_CURSO'"))->idGrupoValores;

(2)$criterio = new CDbCriteria();
(3)$criterio->condition = 'idGrupoValores=:idGrupoValores and idGrupoValoresDetalle=:idGrupoValoresDetalle';
(4)$criterio->params = array(':idGrupoValores'=>$IdGrupo, ':idGrupoValoresDetalle'=>$this->IdTipoCurso);

(5)$model = Grupovaloresdetalle::model()->find($criterio);

(6)return $model->NomValor;
}

lines between 1 and 4 it's OK but the 5 line produce an error, i can't see this error, i see error 500.

i use:
- operating system : Windows vista
- Web server : IIS
- browser type : Chrome
- Yii version : Yii 1.1.14
0

#2 User is offline   ASPtoYiiDev 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 18-June 13

Posted 26 May 2014 - 09:16 AM

Enable DEBUG in index.php to see the full error stack. The error 500 should at least mention something, though if you are making an AJAX request it can be hard to see unless you print the response data error.

Also, you can use code tags in your post to place your code in.
0

#3 User is offline   sergiolinares 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-March 14

Posted 26 May 2014 - 02:39 PM

View PostASPtoYiiDev, on 26 May 2014 - 09:16 AM, said:

Enable DEBUG in index.php to see the full error stack. The error 500 should at least mention something, though if you are making an AJAX request it can be hard to see unless you print the response data error.

Also, you can use code tags in your post to place your code in.


Hi ASPtoYiiDev.

In my index.php i have the follow lines:

defined('YII_DEBUG') or define('YII_DEBUG',true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

but the error the error occurs in the five line:

public function traerDescripcionTipoCurso()
{
(1)$IdGrupo = Grupovalores::model()->find(array('condition'=>"Codigo_ID_Grupo='TIPO_CURSO'"))->idGrupoValores;

(2)$criterio = new CDbCriteria();
(3)$criterio->condition = 'idGrupoValores=:idGrupoValores and idGrupoValoresDetalle=:idGrupoValoresDetalle';
(4)$criterio->params = array(':idGrupoValores'=>$IdGrupo, ':idGrupoValoresDetalle'=>$this->IdTipoCurso);

(5)$model = Grupovaloresdetalle::model()->find($criterio);

(6)return $model->NomValor;
}
0

#4 User is offline   sergiolinares 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-March 14

Posted 26 May 2014 - 06:14 PM

View Postsergiolinares, on 26 May 2014 - 02:39 PM, said:

Hi ASPtoYiiDev.

In my index.php i have the follow lines:

defined('YII_DEBUG') or define('YII_DEBUG',true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

but the error the error occurs in the five line:

public function traerDescripcionTipoCurso()
{
(1)$IdGrupo = Grupovalores::model()->find(array('condition'=>"Codigo_ID_Grupo='TIPO_CURSO'"))->idGrupoValores;

(2)$criterio = new CDbCriteria();
(3)$criterio->condition = 'idGrupoValores=:idGrupoValores and idGrupoValoresDetalle=:idGrupoValoresDetalle';
(4)$criterio->params = array(':idGrupoValores'=>$IdGrupo, ':idGrupoValoresDetalle'=>$this->IdTipoCurso);

(5)$model = Grupovaloresdetalle::model()->find($criterio);

(6)return $model->NomValor;
}

0

#5 User is offline   sergiolinares 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-March 14

Posted 26 May 2014 - 06:18 PM

Finally I found the error. I had an error in my class. Thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users