LOL, damn, didn't my code was so bad lol.
Anyways, here's the new code:
Code:
<?php
// ######################### ERROR REPORTING #############################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('GET_EDIT_TEMPLATES', true);
define('THIS_SCRIPT', 'topxadmin');
require_once('./global.php');
require_once('./includes/functions_misc.php');
print_cp_header("Top X Control Panel");
// ###################### Edit Settings ########################
if ($_REQUEST['do'] == "update")
{
$excludedforums=$DB_site->query_first("SELECT excludedforums FROM topx_admin WHERE id = $topx_adminid");
print_form_header('topxadmin', 'do_update_topxsetting');
print_table_header("Top X Settings");
print_input_row("Forums to exclude", 'exclude_forums',$excludedforums['exclude_forums']);
print_submit_row("Update Top X Settings", 0);
}
if($_POST['do']=="do_update_topxsetting")
{
$DB_site->query(" UPDATE topx_admin SET excludedforums = '" . $_POST['excludedforums'] . "' ");
define('CP_REDIRECT', 'topxadmin.php?act=update');
print_stop_message('excluded_forums_updated');
}
?>
And here's the error I get when clicking the link.
Code:
Database error in vBulletin 3.0.3:
Invalid SQL: SELECT excludedforums FROM topx_admin WHERE id =
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql error number: 1064