Difference between #1 and #2 of
CRUD operation in Yii framework

Revision #2 has been created by samdark on Jan 20, 2019, 9:11:02 PM with the memo:

Set version
« previous (#1)

Changes

Title unchanged

CRUD operation in Yii framework

Category unchanged

Tutorials

Yii version changed

1.1

Tags changed

database,cdbcriteria, database, CRUD

Content changed

[...]
This tutorial teach you the simple way to perform the crud operation in Yii framework, its easy to perform the database operation in Yii.
Here we are going to see the **create, update, delete and select** scripts that required in almost all the applications.

### Create


```php

**// to save all the paramerters of the post request**
$model = new Model;
[...]
### Update

```php

// to update the the whole parameters
$model = new Model;
[...]
### Delete

```php

Model::model()->deleteAll(array('condition' => 'id=:io','params' => array('io' => $_POST['id'])));
```
[...]

```php

// in model
$criteria=new CDbCriteria;
$criteria->compare('status',$this->status,true);
$criteria->compare('name',$this->name,true);
**// if you want to select a few fields the use the following
[...]
0 4
6 followers
Viewed: 33 439 times
Version: 1.1
Category: Tutorials
Written by: Mohammad Fareed
Last updated by: samdark
Created on: Jun 2, 2014
Last updated: 5 years ago
Update Article

Revisions

View all history