change database connection using plugin on runtime
Hello,
While developing a plugin for vBulletin I found myself needing a database connection to another database on another database server. I thought that I could just intialialize a new connection using $vbulletin->db->connect($db, $host, $port, $user, $pass), but this is not working for me:
MySQL Error: mysqli_real_connect() [<a href='function.mysqli-real-connect'>function.mysqli-real-connect</a>]: (HY000/2002): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/includes/class_core.php on line 1134
It is not supposed to use a socket, but a connection using the host and port. How can I solve this, or how can I (temporarely) switch the vBulletin database connection in another way?
Best regards,
Raymond
|