SA-MP Forums Archive
mysql connecting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql connecting (/showthread.php?tid=653296)



mysql connecting - EzeGODezE - 30.04.2018

i have this
#define MYSQL_HOSTNAME "127.0.0.1"
#define MYSQL_DATABASE "server824db"
#define MYSQL_USERNAME "server824db"

but idk how to connect it using mysql plugin.

[17:27:35] [debug] mysql_unprocessed_queries

[17:27:35] [debug] WP_Hash


Re: mysql connecting - kovac - 30.04.2018

PHP код:
//On top
new MySQLDatabase;
//OnGameModeInit
new MySQLOptoption_id mysql_init_options();
    
mysql_set_option(option_idAUTO_RECONNECTtrue); // We will set that option to automatically reconnect on timeouts.
    
Database mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_PASSMYSQL_DATABASEoption_id);
    if(
Database == MYSQL_INVALID_HANDLE || mysql_errno(Database) != 0// Checking if the database connection is invalid to shutdown.
    
{
        print(
"MySQL Database: Connection to database failed!");
        
SendRconCommand("exit");
        return 
1;
    }
    print(
"MySQL Database: Successfully connected."); 



Re: mysql connecting - EzeGODezE - 06.05.2018

cant compile mysql init options im using r40 blueg then it gives me 26 errors


Re: mysql connecting - kovac - 06.05.2018

update mysql plugin, i'm using R41-2