0

I have two website. first one is in wordpress and second one is in corephp. My Question is that i am connection database by $wpdb.

/* Core php database */

$newwpdb = new wpdb( 'username', 'password', 'database', 'localhost' );

Database connection is done. Now i am fetching some data using second database. After fetching i want to close the connection of core php database.

I have checked but not found any solution of it. Database connection close

So anybody knows than please help me for solution.

Thanking in advance

3
  • That link does give the answer. It says to use @mysql_close($newwpdb->dbh) to close connection.
    – sakibmoon
    Commented Aug 19, 2014 at 13:53
  • But its not working. @mysql_close($newwpdb->dbh) close the connection of wordpress as well.
    – Arvind Pal
    Commented Aug 19, 2014 at 14:31
  • 1
    That should work and this seems to be exact duplicate to the question you are linked to. Please double check your code. Note that different API might be used.
    – Rarst
    Commented Aug 19, 2014 at 14:50

0

Browse other questions tagged or ask your own question.