Wiki

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

Auto set model fields values

Updated about a year ago by vibhaJadwaniTutorials3 comments – viewed 12,915 times – ( +8 ) – version 1.1
This is a tutorial for how to auto set model values without any code.

Update two models with one view

Updated 2 years ago by SebKTips10 comments – viewed 29,938 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 2 years ago by sebTips1 comment – viewed 8,042 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 2 years ago by ifdatticTips3 comments – viewed 28,779 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 2 years ago by Tudor IlisoiOthers0 comments – viewed 8,085 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 3 years ago by jwerdHow-tos4 comments – viewed 11,614 times – ( +2 ) – version 1.1
Sub-domains with different databases in Yii!

Single table inheritance

Updated 3 years ago by samdarkHow-tos6 comments – viewed 21,955 times – ( +38 ) – 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 3 years ago by samdarkTips2 comments – viewed 8,803 times – ( +12 ) – 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 3 years ago by Maurizio Domba CerinTips2 comments – viewed 12,170 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?

Multiple Databases and Multiple Domains

Updated 3 years ago by Maurizio Domba CerinTutorials2 comments – viewed 29,032 times – ( +14 / -2 ) – version 1.1
Add these lines in /config/main.php
tags: database