Wiki articles tagged with "database"

Showing 1-20 of 21 items.

Active Record snapshotting (Model data base history)

Created 4 years ago by Bizley, updated 4 years ago by Bizley.

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.

1 0
5 followers
Viewed: 10 927 times
Version: 1.1
Category: Tutorials

CRUD operation in Yii framework

Created 5 years ago by Mohammad Fareed, updated 6 months ago by samdark.

Simple Yii Script for performing CRUD operations:

0 4
6 followers
Viewed: 22 105 times
Version: 1.1
Category: Tutorials

Insert data from database to another database table

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 years ago by Kostas Apazidis (KonApaz).

According to below wiki we could migrate database schema to another database

1 0
2 followers
Viewed: 9 251 times
Version: 1.1
Category: Tutorials

Generate CTreeview from database table and update a model

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 years ago by Kostas Apazidis (KonApaz).

Suppose we want to set a category to product (or an item in general term), Also suppose categories has sub-categories (multi-level)

1 0
1 follower
Viewed: 9 284 times
Version: 1.1
Category: How-tos

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

Created 5 years ago by Kartik V, updated 5 years ago by Kartik V.

Note the tag {{homeUrl}} will be dynamically replaced at runtime.

0 3
40 followers
Viewed: 12 710 times
Version: 2.0
Category: Tutorials

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

Created 5 years ago by tomvdp, updated 5 years ago by tomvdp.

The classic Yii way for doing an update action is as follows:

1 0
3 followers
Viewed: 16 746 times
Version: 1.1
Category: How-tos

Multi Data Provider

Created 5 years ago by Sharon Lavie, updated 3 years ago by Sharon Lavie.

Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).

1 0
4 followers
Viewed: 12 407 times
Version: 1.1
Category: Tips

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

Created 6 years ago by Rajith R, updated 4 years ago by parthshah.

create a class file under protected\components named RActiveRecord.php

6 0
12 followers
Viewed: 34 503 times
Version: 1.1
Category: How-tos

How to display static pages in Yii with database content?

Created 6 years ago by yasen, updated 6 years ago by yasen.

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:

3 0
13 followers
Viewed: 33 817 times
Version: 1.1
Category: Tutorials

Auto set model fields values

Created 7 years ago by vibhaJadwani, updated 7 years ago by vibhaJadwani.

This is a tutorial for how to auto set model values without any code.

5 0
11 followers
Viewed: 24 701 times
Version: 1.1
Category: Tutorials

How to catch and log MySQL deadlock errors

Created 7 years ago by seb, updated 7 years ago by seb.

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.

4 0
7 followers
Viewed: 15 191 times
Version: 1.1
Category: Tips
Tags: database

Update two models with one view

Created 7 years ago by sensorario, updated 7 years ago by SebK.

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).

9 2
13 followers
Viewed: 46 574 times
Version: 1.1
Category: Tips

Use application on production/development environment without making changes

Created 7 years ago by ifdattic, updated 7 years ago by ifdattic.

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.

8 1
11 followers
Viewed: 61 223 times
Version: 1.1
Category: Tips

Application-driven database with CDbMigration and an extended CActiveRecord

Created 7 years ago by Tudor Ilisoi, updated 7 years ago by Tudor Ilisoi.

This is an incipient implementation of application-driven database with Yii.

8 0
10 followers
Viewed: 12 715 times
Version: 1.1
Category: Others

Guidelines for good schema design

Created 7 years ago by Steve Friedl, updated a year ago by softark.

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.

122 0
70 followers
Viewed: 98 271 times
Version: 1.1
Category: Tips

Sub-domains with different databases in Yii!

Created 8 years ago by jwerd, updated 8 years ago by jwerd.

I used another example posted here a while back where the person was modifying the index.php and adding in a switch case for different domains and loading separate config files. This was actually too much for me, because all my portals are the exact same (as far as routes, modules, extensions, etc) and if I ever wanted to add another route it wouldn't be feasible opening up all the config files t...

2 0
12 followers
Viewed: 20 106 times
Version: 1.1
Category: How-tos

Single table inheritance

Created 8 years ago by samdark, updated 8 years ago by samdark.

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...

34 0
36 followers
Viewed: 44 307 times
Version: 1.1
Category: How-tos

A simple class to use a different db for a module

Created 8 years ago by tydeas_dr, updated 8 years ago by Maurizio Domba Cerin.

What would you do if you want/need to have a different than the main database connection in an module's models?

8 0
12 followers
Viewed: 23 762 times
Version: 1.1
Category: Tips

Getting nulls from database instead of empty strings

Created 8 years ago by samdark, updated 8 years ago by samdark.

To get null from database instead of empty strings you need to set up your DB connection as follows:

13 0
11 followers
Viewed: 14 482 times
Version: 1.1
Category: Tips
Tags: database, null

Multiple-database support in Yii

Created 8 years ago by Steve Friedl, updated 7 years ago by phazei.

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.

20 0
40 followers
Viewed: 121 271 times
Version: 1.1
Category: How-tos
Tags: database