Example code:
Simple question: How would I change it to connect to a remote MySQL database instead of the XF database?
PHP:
<?php
class Test_Callback {
public static function testQuery(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response) {
$mydb = XenForo_Application::get('db');
$testQuery = $mydb->fetchAll("
SELECT username,avatar_date
FROM `xf_user`
WHERE `avatar_date` > 0
ORDER BY `avatar_date` DESC");
$response->params['testQuery'] = $testQuery;
}
}
Simple question: How would I change it to connect to a remote MySQL database instead of the XF database?
Last edited: