Well I'm making a page that will add pages to my sit but when you post it says:
Quote:
Database error in vBulletin 3.5.4:
Invalid SQL:
INSERT INTO page
name='EPS',
edit_by='Rdsx',
status='1',
contents='OFB Info Movies Pictues';
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 'name='EPS',
edit_by='Rdsx',
status='1',
contents='OFB Info Mo' at line 2
Error Number : 1064
|
My php code is:
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'Adminpages');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array(
'site_admin_add',
);
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
chdir('/home/rdsx667/public_html/forum/');
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = array();
$navbits[$parent] = admin;
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
// ################ SHOW NO PERMISSION PAGE TO GUESTS ####################
if (!is_member_of($vbulletin->userinfo, 11) AND !is_member_of($vbulletin->userinfo, 6))
{
print_no_permission();
}
// ########################### ADD THE SITE ##############################
if ($_REQUEST['do'] == "add")
{
eval('print_output("' . fetch_template('site_admin_add') . '");');
}
if ($_REQUEST['save'] == "add")
{
//------------------------------------------------------------
// Add the site to the database if everything is ok.
//------------------------------------------------------------
// Sanitize User Submitted Data
$vbulletin->input->clean_array_gpc('p', array(
'name' => TYPE_STR,
'description' => TYPE_STR
));
$sql = "INSERT INTO " . TABLE_PREFIX . "page
name='".$db->escape_string($vbulletin->GPC['name'])."',
edit_by='".$db->escape_string($vbulletin->userinfo['username'])."',
status='1',
contents='".$db->escape_string($vbulletin->GPC['description'])."'";
$db->query_write($sql);
}
?>