I got an error.

Error Code:

Warning: Invalid argument supplied for foreach() in /home/touchcpa/public_html/wp-content/db.php on line 164

Fatal error: Call to undefined method m_wpdb::handle_error_connecting() in /home/touchcpa/public_html/wp-content/db.php on line 223

Here’s my setting…

db-config.php:

define (‘DB_SCALING’, ’16’:wink:;

add_dc_ip(‘127.0.0.1’, ‘dc1’:wink:;

add_global_table(‘andytsai_nrg_global’:wink:;

add_db_server(‘global’, ‘dc1′, 1, 1,”,’127.0.0.1’, ‘andytsai_nrg_global’, ‘user’, ‘pass’:wink:;

add_db_server(‘0’, ‘dc1′, 1, 1,”,’127.0.0.1’, ‘andytsai_nrg_0’, ‘user’, ‘pass’:wink:;

add_db_server(‘1’, ‘dc1′, 1, 1,”,’127.0.0.1’, ‘andytsai_nrg_1’, ‘user’, ‘pass’:wink:;

move-blogs.php:

$dbname = “andytsai_nrg_”;

$blog_table_prefix = ‘wpmu_’;

$newdb_prefix = ‘andytsai_nrg_’;

$dbhost = ‘localhost’;

$dbuname = ‘user’;

$dbpass = ‘pass’;

$db_scaling = ’16’;

I don’t understand where’s wrong.

Could anyone help me to solve this problem?

Or you have the same problem.

Thanks a lot.

  • Mason
    • DEV MAN’s Sidekick

    Hiya!

    When are you getting this error? During move-blogs.php?

    Just to make sure, you do have all 16 new databases in your db-config file right? Not just the 2 lines you show above (plus the global db).

    I’ll ask the dev team to stop by as well and see if anyone else has an idea for ya.

    Thanks!

  • JimKernan
    • Flash Drive

    I am getting the same errors when I try to access might site’s homepage. I went through the installation process and everything seemed to work fine. However, I cannot access my site unless I remove the multi-db files. Any suggestions?

  • turkon
    • Flash Drive

    I have solved the problem. I was living the problem because of localhost.Firstly I have put an ip there. Use like below. The errors will go. And everything seems working right now.

    add_db_server(‘global’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_global’, ‘username’, ‘password’:wink:;

    add_db_server(‘0’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_0’, ‘username’, ‘password’:wink:;

    add_db_server(‘1’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_1’, ‘username’, ‘password’:wink:;

    add_db_server(‘2’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_2’, ‘username’, ‘password’:wink:;

    add_db_server(‘3’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_3’, ‘username’, ‘password’:wink:;

    add_db_server(‘4’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_4’, ‘username’, ‘password’:wink:;

    add_db_server(‘5’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_5’, ‘username’, ‘password’:wink:;

    add_db_server(‘6’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_6’, ‘username’, ‘password’:wink:;

    add_db_server(‘7’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_7’, ‘username’, ‘password’:wink:;

    add_db_server(‘8’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_8’, ‘username’, ‘password’:wink:;

    add_db_server(‘9’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_9’, ‘username’, ‘password’:wink:;

    add_db_server(‘a’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_a’, ‘username’, ‘password’:wink:;

    add_db_server(‘b’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_b’, ‘username’, ‘password’:wink:;

    add_db_server(‘c’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_c’, ‘username’, ‘password’:wink:;

    add_db_server(‘d’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_d’, ‘username’, ‘password’:wink:;

    add_db_server(‘e’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_e’, ‘username’, ‘password’:wink:;

    add_db_server(‘f’, ‘dc1′, 1, 1,’174.123.140.120′,’localhost’, ‘ra6org1_f’, ‘username’, ‘password’:wink:;

    But I have some questions,how will I be sure about the server’s database if it is using the old one or new ones?

    Regards,

    Mustafa

  • turkon
    • Flash Drive

    James, I have disabled the users for my old database. And I am getting the error. So I think I was using the old database. What is the reason for this? What must I do?

    Regards,

    Mustafa

    Error establishing a database connection

  • turkon
    • Flash Drive

    I think I have solved the problem by changing wp-config to my new global database and password.

    But I have seen that I didnt add

    add_global_table(‘ra6org1_global’:wink:; to the first line of db-config before.

    I have now changed it like below. So will it make a problem changing it later?

    add_global_table(‘ra6org1_global’:wink:;

    add_global_table(‘autoblog’:wink:;

    add_global_table(‘blogs’:wink:;

    add_global_table(‘blog_versions’:wink:;

    add_global_table(‘commentmeta’:wink:;

    add_global_table(‘comments’:wink:;

    add_global_table(‘forums’:wink:;

    add_global_table(‘forums_posts’:wink:;

    add_global_table(‘forums_topics’:wink:;

    add_global_table(‘links’:wink:;

    add_global_table(‘options’:wink:;

    add_global_table(‘postmeta’:wink:;

    add_global_table(‘posts’:wink:;

    add_global_table(‘registration_log’:wink:;

    add_global_table(‘scaptcha’:wink:;

    add_global_table(‘scaptcha_logs’:wink:;

    add_global_table(‘signups’:wink:;

    add_global_table(‘signup_language’:wink:;

    add_global_table(‘site’:wink:;

    add_global_table(‘sitemeta’:wink:;

    add_global_table(‘site_posts’:wink:;

    add_global_table(‘support_faq’:wink:;

    add_global_table(‘support_faq_cats’:wink:;

    add_global_table(‘support_tickets’:wink:;

    add_global_table(‘support_tickets_cats’:wink:;

    add_global_table(‘support_tickets_messages’:wink:;

    add_global_table(‘terms’:wink:;

    add_global_table(‘term_counts’:wink:;

    add_global_table(‘term_relationships’:wink:;

    add_global_table(‘term_taxonomy’:wink:;

    add_global_table(‘usermeta’:wink:;

    add_global_table(‘users’:wink:;

    add_global_table(‘ust’:wink:;

  • turkon
    • Flash Drive

    Sorry correcting my last post.

    Everything seems working correct now. But drmike has told me above to remove some things from db-config like add_global_table(‘users’:wink:; So which ones above must stay? And which ones I must remove?