You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove this code and use directly new Param($value, $dataType)
To avoid problems with support values of array fields, eg:
$value = [$val1, $val2]; // where $val2 in array $this->getDataTypes()// or$value = ['key' => $val1, 1 => $val2];
The problem when you use array containing the value as the first element and the PDO type as the second you can get unexpected result for array fields, e.g.
$db->createCommand()->createTable('{{%table}}', ['array' => 'json'])->execute(); // or array type instead of json ('integer []')$db->createCommand()->insert('{{%table}}', ['array' => [1, 2]])->execute();
$result = $db->createCommand('SELECT * FROM {{%table}}')->queryScalar();
// expected $result === '[1, 2]'
The text was updated successfully, but these errors were encountered:
yii\db\PdoValue class has been introduced to replace a special syntax that was used to declare PDO parameter type
when binding parameters to an SQL command, for example: ['value', \PDO::PARAM_STR].
You should use new PdoValue('value', \PDO::PARAM_STR) instead. Old syntax will be removed in Yii 2.1.
https://github.com/yiisoft/db/blob/master/src/Schema/AbstractColumnSchema.php#L274
Remove this code and use directly
new Param($value, $dataType)
To avoid problems with support values of array fields, eg:
The problem when you use array containing the value as the first element and the PDO type as the second you can get unexpected result for array fields, e.g.
The text was updated successfully, but these errors were encountered: