控制台显示这个错误表示什么意思呢
Invalid DBI result handle -1回复: 控制台显示这个错误表示什么意思呢
/*AMXX-Studio ??*//* UTF-8 func by www.DT-Club.net */
#include <amxmodx>
#include <amxmisc>
#include <dbi>
#include <cstrike>
#include <csstats>
#include <fun>
#include <string>
#define MAX_STRING_LENGTH 33
#define INDEX 33
new g_players_name
//mysql struct
new g_host
new g_user
new g_pass
new g_dbname
new g_sql_table
new g_error
public plugin_init()
{
register_plugin("cheatkick", "1.0", "kof");
register_cvar("sql_host","127.0.0.1") //sql host
register_cvar("sql_user","root") //sql username
register_cvar("sql_pass","test") //sql password
register_cvar("sql_db","cheat") //database name
register_cvar("sql_table", "ban") //table name
get_cvar_string("sql_host", g_host,MAX_STRING_LENGTH)
get_cvar_string("sql_user", g_user,MAX_STRING_LENGTH)
get_cvar_string("sql_pass", g_pass,MAX_STRING_LENGTH)
get_cvar_string("sql_db", g_dbname,MAX_STRING_LENGTH)
get_cvar_string("sql_table", g_sql_table,MAX_STRING_LENGTH)
//???...
}
public client_connect(id)
{
new Sql:db= dbi_connect(g_host,g_user,g_pass,g_dbname,g_error,MAX_STRING_LENGTH)
if (db!= SQL_FAILED)
{
get_user_name(id,g_players_name, MAX_STRING_LENGTH-1)
new Result:QueryResult = dbi_query(db,"SELECT * FROM `%s` WHERE auth ='%s'",g_sql_table,g_players_name)
if (QueryResult == RESULT_NONE)
{
//new userid2 = get_user_userid(id)
log_amx(" Sorry")
//server_print("zhi xing dao le");
//server_cmd("kick #%d", g_players_name)
}
}else{
//log_amx(" MYSQL Connection Failed!")
//server_print("zhi xing dao le");
server_cmd("kick #%d", g_players_name)
//return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
回复: 控制台显示这个错误表示什么意思呢
返回结果集句柄无效.new Result:QueryResult = dbi_query(db,"SELECT * FROM `%s` WHERE auth ='%s'",g_sql_table,g_players_name)
if (QueryResult<= RESULT_NONE) //表示无数据返回
{
//new userid2 = get_user_userid(id)
log_amx(" Sorry")
//server_print("zhi xing dao le");
//server_cmd("kick #%d", g_players_name)
}
}else{
//log_amx(" MYSQL Connection Failed!")
//server_print("zhi xing dao le");
server_cmd("kick #%d", g_players_name)
//return PLUGIN_CONTINUE
}
</SPAN>
回复: 控制台显示这个错误表示什么意思呢
插件再修改修下看看...............
页:
[1]