here you go sluggo. Replace the first part in the sma with the 2nd part. make sure you set the values in the 2nd part to your settings that you want to do. It will just be hard coded into the plugin.
Code:
#if defined USING_SQL
public sql_init() {
new host[64], username[32], password[32], dbname[32], error[256]
get_cvar_string("amx_sql_host",host,63)
get_cvar_string("amx_sql_user",username,31)
get_cvar_string("amx_sql_pass",password,31)
get_cvar_string("amx_sql_db",dbname,31)
new Sql:mysql = dbi_connect("localhost", "dvander", "pass", "dbase")
dbc = dbi_connect(host,username,password,dbname,error,255)
if (dbc == SQL_FAILED)
log_amx("[AMXX] SQL Connection Failed = %s", error)
else
{
dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `freqfragger` (`lastname` VARCHAR(32) NOT NULL,`steamid` VARCHAR(32) NOT NULL,`connecttime` INT NOT NULL,`totalkills` INT NOT NULL,`totaldeaths` INT NOT NULL,`date` TIMESTAMP, PRIMARY KEY(`steamid`))")
}
}
#endif
Code:
#if defined USING_SQL
public sql_init() {
dbc = dbi_connect("yourhost", "yourusername", "yourpass", "yourdbname")
if (dbc == SQL_FAILED)
log_amx("[AMXX] SQL Connection Failed")
else
{
dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `freqfragger` (`lastname` VARCHAR(32) NOT NULL,`steamid` VARCHAR(32) NOT NULL,`connecttime` INT NOT NULL,`totalkills` INT NOT NULL,`totaldeaths` INT NOT NULL,`date` TIMESTAMP, PRIMARY KEY(`steamid`))")
}
}
#endif