insert Ignore 和 insert On Duplicate Update





class Mysql_ActiveRecord extends CActiveRecord{


	public function insertIgnore($attributes = null){

		try{

			$this->insert($attributes);

		}

		catch(CDbException $e){

			

		}

	}

	

	public function insertOnDuplicateUpdate($attributes = null){

		try{

			$this->insert($attributes);

		}

		catch(CDbException $e){

			$this->update($attributes);

		}

	}

}



没测试