Wiki

Articles tagged with "database", sorted by commentsX
Displaying 11-20 of 21 result(s).

Auto set model fields values

Created 3 years ago by vibhaJadwaniTutorials3 comments – viewed 16,776 times – ( +9 ) – version 1.1
This is a tutorial for how to auto set model values without any code.

Multiple Databases and Multiple Domains

Created 5 years ago by got 2 doodleTutorials2 comments – viewed 34,952 times – ( +15 / -2 ) – version 1.1
Add these lines in /config/main.php
tags: database

Getting nulls from database instead of empty strings

Created 4 years ago by samdarkTips2 comments – viewed 10,237 times – ( +13 ) – version 1.1
To get null from database instead of empty strings you need to set up your DB connection as follows:
tags: database, null

A simple class to use a different db for a module

Created 4 years ago by tydeas_drTips2 comments – viewed 14,761 times – ( +9 ) – version 1.1
What would you do if you want/need to have a different than the main database connection in an module's models?

How to catch and log MySQL deadlock errors

Created 3 years ago by sebTips1 comment – viewed 10,004 times – ( +4 ) – version 1.1
This method allows to log InnoDB monitor output when deadlock error occured. This way we will have much more useful data to find and fix deadlock.
tags: database

Application-driven database with CDbMigration and an extended CActiveRecord

Created 3 years ago by Tudor IlisoiOthers0 comments – viewed 9,412 times – ( +8 ) – version 1.1
This is an incipient implementation of application-driven database with Yii.
tags: database, model

Multi Data Provider

Created about a year ago by Sharon LavieTips0 comments – viewed 6,812 times – ( +1 )
Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).

How to avoid a database update if the ActiveRecord was not modified

Created about a year ago by tomvdpHow-tos0 comments – viewed 5,759 times – ( +1 ) – version 1.1
The classic Yii way for doing an update action is as follows:

How to store array/widget configuration to the database with config validation rules

Created about a year ago by Kartik VTutorials0 comments – viewed 3,993 times – ( +38 / -4 ) – version 2.0
You may have scenarios, where you want to store a specific array configuration to the database. A classic example could be saving Yii widget configuration to the database and then retrieving it at runtime, with dynamic parameters set. This wiki discusses one of the approaches to do this. Let's consider you have something like the NavBar configuration below to store in the db:

Generate CTreeview from database table and update a model

Created about a year ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 3,644 times – ( +1 ) – version 1.1
Suppose we want to set a category to product (or an item in general term), Also suppose categories has sub-categories (multi-level)