Answer the question
In order to leave comments, you need to log in
Insert into db 50,000 rows in Yii1?
Good afternoon!
In Yii2, you can write several rows to the database at once in this way:
$conditions .= "("."\"". $value[0]."\","."\"".$value[1]."\"), ";
$ResultSql_dannie = substr($conditions, 0, strlen($conditions) - 2);
Yii::$app->db->createCommand('INSERT INTO table_name (content,data_pablich) VALUES '.$ResultSql_dannie.'')->execute();
$sql = "INSERT INTO table_name (name, slug) VALUES (:name, :slug)";
$parameters = array(":name"=>'Tester', ":slug"=>'[email protected]');
//Такой вариант не катит
//$parameters .= array(":name"=>'Tester', ":slug"=>'[email protected]');
//$parameters .= array(":name"=>'Tester', ":slug"=>'[email protected]');
Yii::app()->db->createCommand($sql)->execute($parameters );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question