SA-MP Forums Archive
Converting mysql_ping - 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: Converting mysql_ping (/showthread.php?tid=477985)



Converting mysql_ping - AchievementMaster360 - 27.11.2013

Well so i have this MySQL plugin but mysql_ping got removed so im not sure how to change it so it does the same function but without mysql_ping

PHP код:
if(mysql_ping(MainPipeline) == -1)
    {
        
printf("[MySQL] (MainPipeline) Fatal Error! Could not connect to MySQL: Host %s - DB: %s - User: %s"SQL_HOSTSQL_DBSQL_USER);
        print(
"[MySQL] Note: Make sure that you have provided the correct connection credentials.");
        
SendRconCommand("exit");
    }
    else
    {
        print(
"[MySQL] (MainPipeline) Connection successful toward MySQL Database Server!");
    } 



Re: Converting mysql_ping - Konstantinos - 27.11.2013

Something like:
pawn Код:
MainPipeline = mysql_connect(...); // EDIT THE ARGUMENTS

switch(mysql_errno(MainPipeline))
{
    case 0: print("[MySQL] (MainPipeline) Connection successful toward MySQL Database Server!");
    case 2003:
    {
        printf("[MySQL] (MainPipeline) Fatal Error! Could not connect to MySQL: Host %s - DB: %s - User: %s", SQL_HOST, SQL_DB, SQL_USER);
        print("[MySQL] Note: Make sure that you have provided the correct connection credentials.");
        SendRconCommand("exit");
        return 1;
    }
}



Re: Converting mysql_ping - AchievementMaster360 - 27.11.2013

Thank you very much