runelynx
Member
Hiya -
Creating my first addon so I can display data from a remote MySQL DB. I've pieced together the details so far from various threads. I assume I'm missing an include (or a "use" in XF-land)... but for the life of me I cannot find where that documentation is. Can anyone help?
An exception occurred: [Error] Class 'Runic\Connect\Zend_Db' not found in src/addons/Runic/Connect/Execute.php on line 18
Code:
Creating my first addon so I can display data from a remote MySQL DB. I've pieced together the details so far from various threads. I assume I'm missing an include (or a "use" in XF-land)... but for the life of me I cannot find where that documentation is. Can anyone help?
An exception occurred: [Error] Class 'Runic\Connect\Zend_Db' not found in src/addons/Runic/Connect/Execute.php on line 18
Code:
PHP:
<?php
namespace Runic\Connect;
class Execute {
/**
* [USER=103277]@Param[/USER] \XF\Pub\Controller\AbstractController $controller
* [USER=103277]@Param[/USER] \XF\Mvc\Reply\AbstractReply $reply
*/
public static function testQuery(
\XF\Pub\Controller\AbstractController $controller,
\XF\Mvc\Reply\AbstractReply &$reply)
{
//$mydb = XenForo_Application::get('db');
$db = Zend_Db::factory('mysqli',
array(
'---' => $config['db']['host'],
'3306' => $config['db']['port'],
'---' => $config['db']['username'],
'---' => $config['db']['password'],
'rpgame' => $config['db']['dbname'],
'latin1' => $config['db']['charset']
)
);
$testQuery = $db->fetchAll("
SELECT PlayerName FROM rp_PlayerInfo");
$response->params['testQuery'] = $testQuery;
}
}
Last edited: