Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).
Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).
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).
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.
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.
What would you do if you want/need to have a different than the main database connection in an module's models?
To get null
from database instead of empty strings you need to set up your DB connection as follows:
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.