Yii Framework Forum: Ar Records Save() Error - Yii Framework Forum

Jump to content

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

Ar Records Save() Error how do i get errors array if model is not saved Rate Topic: -----

#1 User is offline   Jaimin MosLake 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 10-June 13
  • Location:Ahmedabad

Posted 25 August 2013 - 02:10 AM

I have defined some value to insert into database..
and when i call to save it returns false .. so i want to know
How can i do this in yii..
and i want to add it i have validated all inputs...
after that i am doing this.. in actionInsert (site controller)

if($modelA->save())
{
echo 'Saved';
}
else
{
//here i want to get errors array ... i want to know why it is not saved.. is there any //function similiar to  mysqli_errors()
 
}

Jaimin MosLake
0

#2 User is offline   Jaimin MosLake 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 10-June 13
  • Location:Ahmedabad

Posted 25 August 2013 - 02:21 AM

View PostJaimin MosLake, on 25 August 2013 - 02:10 AM, said:

I have defined some value to insert into database..
and when i call to save it returns false .. so i want to know
How can i do this in yii..
and i want to add it i have validated all inputs...
after that i am doing this.. in actionInsert (site controller)

if($modelA->save())
{
echo 'Saved';
}
else
{
//here i want to get errors array ... i want to know why it is not saved.. is there any //function similiar to  mysqli_errors()
 
}




I have solved it ... its getErrors()...
Jaimin MosLake
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