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_IsNull Null . » AmxModX
| |
 RSS
  • OnLine

    : 4
    : 2
    : -
    : crawl Bot, Yandex Bot

    ?

    • AMX Mod X
    • up.org.ua


  • : Admin : 24-04-2012, 13:21 : 2536

    SQL_IsNull Null .

    SQL, SQL_IsNull, ""(NULL ) .

    sql.inc:
    /**
    * Tells whether a specific column in the current row
    *  is NULL or not.
    */
    native SQL_IsNull(Handle:query, column);


    :
    SQL_IsNull(Handle:query, column)

    • Handle:query -
    • column -
    1 0 .

    :
    Native

    :
    /* Plugin generated by AMXX-Studio */

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

    #define PLUGIN "[SQLx.inc] SQL_IsNull"
    #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` WHERE `id` = '1' ")
        SQL_Execute (query)

        server_print("SQL_IsNull %s",SQL_IsNull(query,1)? "Yes" : "No")
        
    }
    public plugin_end(){
        
        SQL_FreeHandle(SQL_Tuple)
        SQL_FreeHandle(SQL_Connection)
        
    }


    :
    select_sql
    , .
    server_print("SQL_IsNull %s",SQL_IsNull(query,1)? "Yes" : "No")

    .
    , .
    .
    SQL_IsNull Null .