Permalink
Browse files

fix

  • Loading branch information...
1 parent 1344141 commit d90ca2559f7266e37bb49e508243cffbbe54c98f @RSol committed Sep 21, 2012
Showing with 22 additions and 19 deletions.
  1. +22 −19 readme.md
View
@@ -38,33 +38,36 @@ Exemple
MULTI INSERT
```php
- Yii::app()->db->insert('table', array(
- array('field'=>1),
- array('field'=>2),
- array('field'=>3),
- array('field'=>4),
- array('field'=>5),
- ...
- array('field'=>'n'),
- ));
+ Yii::app()->db->createCommand()
+ ->insert('table', array(
+ array('field'=>1),
+ array('field'=>2),
+ array('field'=>3),
+ array('field'=>4),
+ array('field'=>5),
+ ...
+ array('field'=>'n'),
+ ));
```
INSERT IGNORE ...
```php
- Yii::app()->db->insertIgnore('table', array(
- 'keyfield'=>1,
- 'field'=>0,
- ));
+ Yii::app()->db->createCommand()
+ ->insertIgnore('table', array(
+ 'keyfield'=>1,
+ 'field'=>0,
+ ));
```
INSERT ... ON DUPLICATE KEY UPDATE
```php
- Yii::app()->db->insertUpdate('table', array(
- 'keyfield'=>1,
- 'field'=>0,
- ), array(
- 'field'=>new CDbExpression('field+1'),
- ));
+ Yii::app()->db->createCommand()
+ ->insertUpdate('table', array(
+ 'keyfield'=>1,
+ 'field'=>0,
+ ), array(
+ 'field'=>new CDbExpression('field+1'),
+ ));
```
License

0 comments on commit d90ca25

Please sign in to comment.