Problem with MySQL plugin
#1

Hi, I have mysql plugin ( win32 ). I made all right. I put library of mysql to C:\WINDOWS , next library to plugins and to server.cfg a wrote plugins mysql . In pawno I have this:
Код:
new val;

LoadSettings()
{
mysql_connect("sql.mydomain.cz", "my_login", "name_of_my_db", "my_password");
mysql_query("SELECT samp_actual FROM samp_setings WHERE samp_version = 0.3");
mysql_store_result();
val = mysql_fetch_int();
mysql_close();
}

ModeInit:
LoadSettings();
and after start samp-server.exe my server go shutdown. Without errors,or some problems. "CommandLine" close and is END. I dont know what I can do Please help me.
PS: sorry for my bad english
Reply
#2

Do not connect to the database in OnGameModeInit, use main().
pawn Код:
main()
{
    mysql_connect("sql.mydomain.cz", "my_login", "name_of_my_db", "my_password");
    mysql_query("SELECT samp_actual FROM samp_setings WHERE samp_version = 0.3");
    mysql_store_result();
    val = mysql_fetch_int();
    mysql_close();
}
Reply
#3

without changes. Same problem
Reply
#4

pawn Код:
main()
{
    mysql_connect("sql.mydomain.cz", "my_login", "name_of_my_db", "my_password");
    mysql_query("SELECT samp_actual FROM samp_setings WHERE samp_version = 0.3");
    mysql_store_result();
    val = mysql_fetch_int();
    mysql_free_result();
    mysql_close();
}
Reply
#5

no .. without changes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)