I get this with the plugin:
Quote:
L 01/14/2012 - 22:147: [Untitled.amxx] SQL error: near "auto_increment": syntax error
L 01/14/2012 - 22:147: [Untitled.amxx] Error while creating steamid table. Pausing plugin.
|
PHP Code:
#define CREATE_TABLE_STEAMIDS "CREATE TABLE IF NOT EXISTS steamids (steamid varchar(40) NOT NULL default '', id int(11) NOT NULL auto_increment, PRIMARY KEY (id), UNIQUE KEY STEAMID (steamid)) TYPE=MyISAM;"
bool:create_tables()
{
new Sql:sql
if (!connect(sql))
{
log_amx("[%s] Failed connecting to database. Pausing plugin.", PLUGINNAME)
pause("ad")
return false
}
new Result:result
format(g_query, QSIZE, "%s", CREATE_TABLE_STEAMIDS)
result = dbi_query(sql, g_query)
if (result <= RESULT_FAILED && dbi_check_error(sql))
{
log_amx("Error while creating steamid table. Pausing plugin.")
disconnect(sql)
pause("ad")
return false
}
jghg_free_result(result)
format(g_query, QSIZE, "%s", CREATE_TABLE_NAMES)
result = dbi_query(sql, g_query)
if (result <= RESULT_FAILED && dbi_check_error(sql))
{
log_amx("Error while creating names table. Pausing plugin.")
disconnect(sql)
pause("ad")
return false
}
jghg_free_result(result)
disconnect(sql)
return true
}
jghg_free_result(Result:result)
{
if(result > RESULT_NONE)
{
dbi_free_result(result)
}
}
dbi_check_error(&Sql:sql)
{
new error[256] = ""
dbi_error(sql, error, 255)
if(error[0] && !equal(error, "Not an error"))
{
log_amx("SQL error: %s", error)
return true
}
return false
}
disconnect(&Sql:sql)
{
if(sql > SQL_FAILED)
{
dbi_close(sql)
sql = SQL_FAILED
}
}
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.