MyBB Community Forums

Full Version: How to connect with other database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm trying to make the same thing but it doesn't work. I tried Yaldaram's code but when I use this line
$timeonline = $dblog->simple_select("lb-players", "playername, onlinetime", "`playername` = '".$referral2['username']."'");
the web goes white and nothing can be seen.

Anyone can help me please?
Hello. You just have to create new database object. I'll assume that you use MySQL.
$newdb = new DB_MySQL;

$con['hostname'] = 'dabase_host';
$con['username'] = 'database_username';
$con['password'] = 'database_password';
$con['database'] = 'database_name';

$newdb->connect($con);
Now for example:
$newdb->query("something");
Pages: 1 2