php - CodeIgniter 3.1.0 form validation issue
CodeIgniter 3.1.0 form validation issue.
I have an CodeIgniter application which use 2 databases:
- Master database: "main_db".
- Slave database: "client1", "client2"....
When user visit my website, I track the user url and get the client information. Then I connect to masterdatabase(main_db)
and get the slave database information. After getting the correct slave database information, then I connect to slave database and the entire application use the slave database.
I have a table named "product_category". with a column name "category_name".
When I am trying to validate the form like
is_unique[product_category.category_name]
When I run the script, the codeigniter use the master database whereas the using slave database is expected.
Table 'main_db.product_category' doesn't exist