25.05.2014, 12:48
pawn Код:
forward ConnectMySQL();
PlayGaming ConnectMySQL()
{
if(mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS))
{
printf("[MYSQL]: Connection to `%s` succesful!",SQL_DB);
mysql_debug(1);
}
else
{
printf("[MYSQL]: [ERROR]: Connection to `%s` failed!",SQL_DB);
}
return 1;
}
/*PlayGaming MySQLDisconnect()
{
mysql_close();
return 1;
}*/
forward MYSQLBANAT(sqlvalname[], sqlresult[]);
NiGamig MYSQLBANAT(sqlvalname[], sqlresult[])
{
new query[128];
format(query, sizeof(query), "SELECT Locked FROM players WHERE Name = %d LIMIT 1", sqlvalname);
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row(sqlresult)==1)
{
return 1;
}
return 0;
}