php - CodeIgniter 3.1.0 form validation issue

228

CodeIgniter 3.1.0 form validation issue.

I have an CodeIgniter application which use 2 databases:

  1. Master database: "main_db".
  2. 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

People are also looking for solutions to the problem: php - How to get sum of all selected data from bootstrap multiselect and show in anoher input?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.