This is about how i did this, tho i'm not sure if there is all that needed
This in index
case 'getcrystals' :
in tpl
{$user.cryst}
class.account
public static function GetCrystals()
{
$Account = $_SESSION['aid'];
$GetPts = doQuery("SELECT Money FROM AccountInfo WHERE accID=".$Account , DATABASE_TRADE);
$row = mssql_fetch_array($GetPts);
return $row['Money'];
}
inc.config
$config['db']['Trade'] = array( 'host' => 'NS528477\SQLEXPRESS',
'db' => 'TradeDB',
'user' => 'TunnusWjaTjaS10',
'pass' => 'OkgiXoMZ%BdA' );
$connections = array( 'game' => false,
'account' => false,
'Auction' => false,
'Trade' => false
inc.functions
'pts' => Account::GetPoints(),
'cred' => Account::GetCredits(),
'mac' => Account::FindMacAddress(),
'refpts' => Account::GetReferred(),
'cryst' => Account::GetCrystals(),