25.11.2010, 04:34
Nice tut!
I even didn't know that this exists XD.
Whatever I have an tip to save diskspace. It's about this part:
You first format the string. That's now not needed, there are no ... idk how it's called but there are not things like this: '%d', '%s', '%i' etc...
So you can just run the query on this way:
I even didn't know that this exists XD.
Whatever I have an tip to save diskspace. It's about this part:
pawn Код:
public OnGameModeInit()
{
top_players = db_open("stats.db");
new query[256];//create a string (I'm not sure if it has to be this big every mysql tutorial I saw had 256 strings
format(query,sizeof(query),"CREATE TABLE IF NOT EXISTS `Users` (`Name`,`stat`)");//format the string
db_free_result(db_query(top_players,query));//query the database and free the result
}
So you can just run the query on this way:
pawn Код:
public OnGameModeInit()
{
top_players = db_open("stats.db");
db_free_result(db_query(top_players, "CREATE TABLE IF NOT EXISTS `Users` (`Name`,`stat`)"));//query the database and free the result
}