Wiki articles tagged with "database"

Showing 1-20 of 22 items.

CRUD operation in Yii framework

Created 11 years ago by Mohammad Fareed Mohammad Fareed, updated 6 years ago by samdark samdark.

Simple Yii Script for performing CRUD operations:

0 4
6 followers
Viewed: 35 990 times
Version: 1.1
Category: Tutorials

Change default date format in Oracle

Created 6 years ago by lenovo lenovo, updated 6 years ago by samdark samdark.

Default date format in Oracle is DD-MON-RR (25-JAN-18). With that output, we can't using date formatting.

0 0
2 followers
Viewed: 81 332 times
Version: 2.0
Category: How-tos
Tags: database

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

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

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

2 3
41 followers
Viewed: 27 826 times
Version: 2.0
Category: Tutorials

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

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

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

1 0
3 followers
Viewed: 30 334 times
Version: 1.1
Category: How-tos

Active Record snapshotting (Model data base history)

Created 10 years ago by Bizley Bizley, updated 10 years ago by Bizley 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: 18 543 times
Version: 1.1
Category: Tutorials

Multi Data Provider

Created 12 years ago by Sharon Lavie Sharon Lavie, updated 10 years ago by Sharon Lavie 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: 20 560 times
Version: 1.1
Category: Tips

Insert data from database to another database table

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

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

1 0
2 followers
Viewed: 17 831 times
Version: 1.1
Category: Tutorials

Generate CTreeview from database table and update a model

Created 11 years ago by Kostas Apazidis (KonApaz) Kostas Apazidis (KonApaz), updated 11 years ago by Kostas Apazidis (KonApaz) 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: 15 291 times
Version: 1.1
Category: How-tos

Sub-domains with different databases in Yii!

Created 14 years ago by jwerd jwerd, updated 14 years ago by jwerd 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: 27 764 times
Version: 1.1
Category: How-tos

How to display static pages in Yii with database content?

Created 13 years ago by yasen yasen, updated 13 years ago by yasen 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: 45 004 times
Version: 1.1
Category: Tutorials

Update two models with one view

Created 14 years ago by sensorario sensorario, updated 13 years ago by SebK 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 3
13 followers
Viewed: 58 788 times
Version: 1.1
Category: Tips

How to catch and log MySQL deadlock errors

Created 13 years ago by seb seb, updated 13 years ago by seb 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: 22 759 times
Version: 1.1
Category: Tips
Tags: database

Use application on production/development environment without making changes

Created 14 years ago by ifdattic ifdattic, updated 14 years ago by ifdattic 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: 79 613 times
Version: 1.1
Category: Tips

Auto set model fields values

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

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

5 0
11 followers
Viewed: 33 268 times
Version: 1.1
Category: Tutorials

Multiple Databases and Multiple Domains

Created 15 years ago by got 2 doodle got 2 doodle, updated 15 years ago by Maurizio Domba Cerin Maurizio Domba Cerin.

Add these lines in /config/main.php

'components'=>array(
.........
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=database1',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => 'itsasecret',
			'charset' => 'utf8',
		),
		'db2'=>array(
		    'class' => 'CDbConnection',
			'connectionString' => 'mysql:host=localhost;dbname=databa...
13 2
15 followers
Viewed: 60 286 times
Version: 1.1
Category: Tutorials
Tags: database

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

Created 12 years ago by Rajith R Rajith R, updated 11 years ago by parthshah parthshah.

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

7 0
13 followers
Viewed: 49 020 times
Version: 1.1
Category: How-tos

A simple class to use a different db for a module

Created 14 years ago by tydeas_dr tydeas_dr, updated 14 years ago by Maurizio Domba Cerin 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: 32 051 times
Version: 1.1
Category: Tips

Application-driven database with CDbMigration and an extended CActiveRecord

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

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

8 0
10 followers
Viewed: 18 055 times
Version: 1.1
Category: Others

Getting nulls from database instead of empty strings

Created 14 years ago by samdark samdark, updated 14 years ago by samdark 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: 22 551 times
Version: 1.1
Category: Tips
Tags: database, null

Multiple-database support in Yii

Created 15 years ago by Steve Friedl Steve Friedl, updated 13 years ago by phazei 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
39 followers
Viewed: 151 580 times
Version: 1.1
Category: How-tos
Tags: database