How do you show query builder error

I know I must be missing something silly. Working with Yii2 for a few months now and for the life of me I cannot find out how to view this.

Every time i add a new record to mySQL using query builder … if something fails in the adding of a record (I.e. some MySQL errors), the page simply continues to run and there seems to be no trace as to why Yii did not create the insert statement (checked yii debugger and it’s not there).

It seems that in some instances when there is an error, it simply does not generate that SQL to process and continues on it’s merry way w/o telling me what’s wrong. What gives?

For example:

$model = new ModelName;

$model-field = "abcd";

$model->save();

In this case I was trying to insert into mysql field a value of 4 characters. Though the mysql field was sufficiently large, the rules generated on the model (from an old Gii generation prior to expanding the field values)

Any ideas? Maybe something to do with the validation not triggering?

Anyone know a good tutorial on how to setup for validation?

Thanks!

Probably it’s not related to db operation directly.

Just trace the code execution with “Yii::trace()”, and you’ll find that a code block for saving is totally skipped with some conditions.