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

Multiple-database support in Yii

Updated 4 years ago by phazeiHow-tos18 comments – viewed 104,993 times – ( +29 ) – version 1.1
The customary configuration of a Yii application includes just a single database section in the protected/config/main.php file, but it's easy to extend this to support more than one, tying each Model to one of the databases.
tags: Database

Auto set model fields values

Updated 4 years ago by vibhaJadwaniTutorials3 comments – viewed 19,683 times – ( +9 ) – version 1.1
This is a tutorial for how to auto set model values without any code.

Update two models with one view

Updated 4 years ago by SebKTips11 comments – viewed 40,876 times – ( +10 / -2 ) – version 1.1
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form

How to catch and log MySQL deadlock errors

Updated 5 years ago by sebTips1 comment – viewed 12,547 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

Use application on production/development environment without making changes

Updated 5 years ago by ifdatticTips3 comments – viewed 49,819 times – ( +8 / -1 ) – version 1.1
I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.

Application-driven database with CDbMigration and an extended CActiveRecord

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

Sub-domains with different databases in Yii!

Updated 5 years ago by jwerdHow-tos5 comments – viewed 16,335 times – ( +2 ) – version 1.1
Sub-domains with different databases in Yii!

Single table inheritance

Updated 5 years ago by samdarkHow-tos8 comments – viewed 35,774 times – ( +41 ) – version 1.1
Relational databases do not support inheritance so if we need to represent it, we have to somehow store meta info while keeping performance by minimizing JOINs. One way to solve this problem is using single table inheritance. All fields for the whole class tree are stored in a single table. Class name is stored in the type field of the same table.

Getting nulls from database instead of empty strings

Updated 5 years ago by samdarkTips2 comments – viewed 12,039 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

Updated 5 years ago by Maurizio Domba CerinTips3 comments – viewed 18,471 times – ( +10 ) – 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?