Problem with MySQL plugin - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Problem with MySQL plugin (
/showthread.php?tid=102837)
Problem with MySQL plugin -
Filka - 17.10.2009
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
Re: Problem with MySQL plugin -
Marcel - 17.10.2009
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();
}
Re: Problem with MySQL plugin -
Filka - 17.10.2009

without changes. Same problem
Re: Problem with MySQL plugin -
Marcel - 17.10.2009
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();
}
Re: Problem with MySQL plugin -
Filka - 17.10.2009
no

.. without changes