Got this minor error , i couldnt fix it .
This is emismand admin panel .This happens when i tried to empty all of a character inventory by character names . However i can empty their inventory using their "CID"Code:Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Name'., SQL state S0022 in SQLExecDirect in C:\Program Files\xampp\htdocs\gunz\joasduee\characters.php on line 162
any ideas wats going on ? Heres the mssql code :
One weird thing for me is CITEMTABLE wont work for char name because theres no such column for citemtable . any ideas ? wad sqls do i need to runPHP Code:elseif( isset($_POST['deletecitems']) )
{
$type = clean_sql($_POST['type']);
$id = clean_sql($_POST['id']);
if( $type == "" || $id == "" )
{
setmessage("Delete C Items", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
if( $type == 0 )
{
$query01 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$id'");
$part = "Name";
}
elseif( $type == 1 )
{
$query01 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE CID = '$id'");
$part = "CID";
}
else
{
redirect("index.php?do=characters");
die();
}
if( num_rows($query01) != 1 )
{
setmessage("Delete C Items", $_STR[Char24]);
redirect("index.php?do=characters");
die();
}
else
{
odbc_exec($connection, "DELETE FROM {$_CONFIG[CItemTable]} WHERE $part = '$id'");
writetolog( sprintf($_STR[Log7], $id) );
setmessage("Delete C Items", $_STR[Char27]);
redirect("index.php?do=characters");
die();
}
}



Reply With Quote

