SAPE ERROR: Не могу подключиться к серверу: dispenser-01.saperu.net/code.php?user=836f97673aa6aa25a35b5029263ee232&host=amxxmodx.ru&charset=windows-1251&format=serialize, type: file_get_contents

SAPE ERROR: Не могу подключиться к серверу: dispenser-02.saperu.net/code.php?user=836f97673aa6aa25a35b5029263ee232&host=amxxmodx.ru&charset=windows-1251&format=serialize, type: file_get_contents

SQL_QueryError » AmxModX
| |
 RSS
  • OnLine

    : 5
    : 4
    : -
    : crawl Bot

    ?

    • AMX Mod X
    • up.org.ua


  • : Admin : 24-04-2012, 13:02 : 2245

    SQL_QueryError

    , pawn, . sqlx SQL_QueryError, .

    sql.inc:
    /**
    * Gets information about a failed query error.
    * Returns the errorcode.
    */
    native SQL_QueryError(Handle:query, error[], maxlength);


    :
    SQL_QueryError(Handle:query, error[], maxlength)

    • Handle:query -
    • error[] -
    • maxlength -


    :
    Native

    :
    /* Plugin generated by AMXX-Studio */

    #include <amxmodx>
    #include <amxmisc>
    #include <sqlx>

    #define PLUGIN "[SQLx.inc] SQL_QueryError"
    #define VERSION "1.0"
    #define AUTHOR "Admin"

    new Handle:SQL_Tuple
    new Handle:SQL_Connection

    public plugin_init() {
        
        
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_cvar("SQLx_host","127.0.0.1")
        register_cvar("SQLx_db","amxxmodx")
        register_cvar("SQLx_user","admin")
        register_cvar("SQLx_password","pass")
        
        register_concmd("select_sql","sqlx_select")
    }
    public plugin_cfg(){
        new host[33],dbase[33],user[33],pass[33]
        get_cvar_string("SQLx_host",host,30)
        get_cvar_string("SQLx_db",dbase,30)
        get_cvar_string("SQLx_user",user,30)
        get_cvar_string("SQLx_password",pass,30)
        SQL_Tuple = SQL_MakeDbTuple(host,user,pass,dbase)
        new err, error[256]
        SQL_Connection = SQL_Connect(SQL_Tuple, err, error, charsmax(error))
        
        if(SQL_Connection != Empty_Handle)
        {
            log_amx("[SQLx connect ok]")
            }else{
            log_amx("[SQLX sql error] %s ",error)
            pause("a")
        }
        
    }
    public sqlx_select(id){
        
        new Handle:query = SQL_PrepareQuery(SQL_Connection,"SELECT * FROM `table`")
        SQL_Execute (query)

        //     
        new error[128]
        //
        SQL_QueryError(query, error, charsmax(error))
        //     
        server_print("[SQL error]:%s",error)
        
    }
    public plugin_end(){
        
        SQL_FreeHandle(SQL_Tuple)
        SQL_FreeHandle(SQL_Connection)
        
    }


    :
    , :
        //       
        new error[128]
        //
        SQL_QueryError(query, error, charsmax(error))
        //     
        server_print("[SQL error]:%s",error)

    :
    [SQL error]:Table 'amxxmodx.table' doesn't exist


    table.
    , .
    .
    SQL_QueryError