Using the existing code speeds up development and minimizes redundant code. Below is the code needed to use the default database object in phpBB.
[php]
define('IN_PHPBB', true);
$phpbb_root_path = './../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$sql = "SELECT * FROM " . A_TABLE . "
WHERE rank_special = 1
ORDER BY a_title";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR,
'Could not obtain ranks data', '', __LINE__, __FILE__, $sql);
}
else echo "Query successsful";
No comments:
Post a Comment