Yii Framework Forum: How to Return Message for an incomplete validation and more... - Yii Framework Forum

Jump to content

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

How to Return Message for an incomplete validation and more... Workflow for Validation Rate Topic: -----

#1 User is offline   bcinteractive 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 17-July 11

Posted 14 July 2012 - 07:11 AM

Hi,

I'm new to this forum and yii framework. I know this is very basic but I don't seem to understand how this should work. Point me to a thread that answers this is okay by me.

Database with a relationship, logging -- should have an existing id in loggers.

When I create a logging record and input an ID that is not present in loggers, a CDbException is displayed. How do I prevent this and just inform the logger that the id is non-existent...

Also it would help if I know which methods are involved and what do I need to put in each method to make this work.

Thanks,

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails 

0

#2 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 15 July 2012 - 03:29 AM

These are main topics you'd better to start with if you whant to customise your error messageshttp://www.yiiframew...en/topics.error
http://www.yiiframew...ntry#debug-mode
http://www.yiiframew...setFlash-detail

Also, you may add custom validation rule to catch the error at $model->validate() stage. (error message will be in $model->errors then) Examples
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