I’ve this command in a migration
$this->db->createCommand()->update('{{%dispositivo_push}}', ['id_f1' => $myval], ['id_f2' => $var1);
id_f1
and id_f2
are integer fields, and when executing the query it produces this:
UPDATE `cb_dispositivo_push` SET `id_f1`=1 WHERE (`id_f2`=1)
Which generates a weird error in MySQL:
Exception: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'comunicazioni'
I found out it solves by adding single quotes around the two 1s, which is a best MySQL pratice IIRC. I was wondering why Yii is not including them. I’m on 2.0.15.1.