Wiki

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

Multiple-database support in Yii

Created 4 years ago by Steve FriedlHow-tos15 comments – viewed 76,896 times – ( +28 ) – 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

Guidelines for good schema design

Created 3 years ago by Steve FriedlTips14 comments – viewed 64,758 times – ( +142 ) – version 1.1
Virtually all Yii applications are built on top of a database, and though Yii is very flexible in how it addresses your DB, some design choices make things more convenient than others.

Update two models with one view

Created 3 years ago by sensorarioTips11 comments – viewed 34,390 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

Single table inheritance

Created 3 years ago by samdarkHow-tos8 comments – viewed 26,048 times – ( +40 ) – 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.

How to display static pages in Yii with database content?

Created 2 years ago by yasenTutorials6 comments – viewed 22,230 times – ( +11 ) – version 1.1
To extend further static pages as shown by Qiang http://www.yiiframework.com/wiki/22/how-to-display-static-pages-in-yii/ here're the steps to take:

Multiple Database Connection : Select database based on login user id, Dynamic

Created about a year ago by Rajith RHow-tos4 comments – viewed 17,451 times – ( +9 / -6 ) – version 1.1
create a class file under protected\components named RActiveRecord.php

CRUD operation in Yii framework

Created 10 months ago by Mohammad FareedTutorials4 comments – viewed 6,094 times – ( +1 / -6 ) – version all
Simple Yii Script for performing CRUD operations:

Sub-domains with different databases in Yii!

Created 3 years ago by jwerdHow-tos4 comments – viewed 13,229 times – ( +2 ) – version 1.1
Sub-domains with different databases in Yii!

Active Record snapshotting (Model data base history)

Created about a month ago by BizleyTutorials3 comments – viewed 2,161 times – ( +2 ) – version 1.1
One of the common tasks the web application might be required to perform, especially the app using some kind of a CMS, is to save the history of data changes. Your client for sure will want the answer to this simple question - If I mess this up or delete by accident can we bring it back? Well, DB backup is one thing and quick recovery is another - let's talk about latter one.

Use application on production/development environment without making changes

Created 3 years ago by ifdatticTips3 comments – viewed 34,892 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.