Admin panel php errors

Results 1 to 5 of 5
  1. #1
    Valued Member Asaki is offline
    MemberRank
    Nov 2009 Join Date
    133Posts

    Admin panel php errors

    Got this minor error , i couldnt fix it .

    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
    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"

    any ideas wats going on ? Heres the mssql code :

    PHP 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 == )
            {
                
    $query01 odbc_exec($connection"SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$id'");
                
    $part "Name";
            }
            elseif( 
    $type == )
            {
                
    $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) != )
            {
                
    setmessage("Delete C Items"$_STR[Char24]);
                
    redirect("index.php?do=characters");
                die();
            }
            else
            {
                
    odbc_exec($connection"DELETE FROM {$_CONFIG[CItemTable]} WHERE $part = '$id'");
                
    writetologsprintf($_STR[Log7], $id) );
                
    setmessage("Delete C Items"$_STR[Char27]);
                
    redirect("index.php?do=characters");
                die();
            }
        } 
    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 run
    Last edited by Asaki; 16-12-09 at 05:30 PM.


  2. #2
    Alpha Member gregon13 is offline
    MemberRank
    Nov 2007 Join Date
    CanadaLocation
    1,945Posts

    Re: Admin panel php errors

    the problem is with the odbc connection

  3. #3
    Valued Member Asaki is offline
    MemberRank
    Nov 2009 Join Date
    133Posts

    Re: Admin panel php errors

    how do i fix it ?

  4. #4
    Account Upgraded | Title Enabled! alfredao is offline
    MemberRank
    Jan 2008 Join Date
    Coronel FabriciLocation
    705Posts

    Re: Admin panel php errors

    Not tested but maybe can work

    PHP 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 == )
            {
                
    $query01 odbc_exec($connection"SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$id'");
            }
            elseif( 
    $type == )
            {
                
    $query01 odbc_exec($connection"SELECT CID FROM {$_CONFIG[CharTable]} WHERE CID = '$id'");
            }
            else
            {
                
    redirect("index.php?do=characters");
                die();
            }

            if( 
    num_rows($query01) != )
            {
                
    setmessage("Delete C Items"$_STR[Char24]);
                
    redirect("index.php?do=characters");
                die();
            }
            else
            {
                
    $a odbc_fetch_array($query01);
                
    $acid $a['CID'];
                
    odbc_exec($connection"DELETE FROM {$_CONFIG[CItemTable]} WHERE CID = '$acid'");
                
    writetologsprintf($_STR[Log7], $id) );
                
    setmessage("Delete C Items"$_STR[Char27]);
                
    redirect("index.php?do=characters");
                die();
            }
        } 
    Last edited by alfredao; 17-12-09 at 05:32 PM.

  5. #5
    Valued Member Asaki is offline
    MemberRank
    Nov 2009 Join Date
    133Posts

    Re: Admin panel php errors

    thanks for the help xD it works



Advertisement