Good time of day. There is a function in which I pass an array, the keys of which coincide with the name of the columns in the table. I want to make a request of this type:
$features = Yii::app()->db->createCommand("INSERT INTO tbl_features SET {$feature}"); Where
$feature = [ 'name'=>'color', 'value'=>'black' ] when executing this script, I get an error
CDbCommand failed to execute SQL query: SQLSTATE [42000]: Syntax error or access violation: 1064 Syntax; If you’re on the line, you’ll find out what you’re reading.
Tell me what I'm doing wrong
->insert........Yii::app()->db->createCommand->insert(...yiiframework.com/doc/guide/1.1/en/database.query-builder#sec-4 - Alexey Shimansky