A_mysql not loading properly
#7

I assume you're using mysql_ping() to retrieve the server connection, that being true/false.

I also assume you're using R7 and above, therefore I have made a piece of code:

pawn Код:
new handle = -1; // at top of script somewhere, before OnGameModeInit

OnGameModeInit(playerid)
{
    handle = mysql_connect("hn", "un", "db", "pw");
   
    if(handle)
    {
        print("[MYSQL] Connection Successful.");
    }
    else
    {
        print("[MYSQL] Connection Unsuccessful.");
    }
   
    //rest of OnGameModeInit code here
}
Queries are threaded, meaning you'd do them like this(R7 -> R30 something)
mysql_function_query(connectionHandle, query[], bool:cache, callback[], format[], {Float,_}:..);

As of R33 or something they're like this:
mysql_tquery(...);

Or use the new ORM(object Relational Mapping) system, but there are tutorials for that.

EDIT #1:

Stay with R7! It's not too different and the speed difference is quite amazing. It's a ton better dude and easier to understand. But if you'd like to stay with R6-2 then feel free
Reply


Messages In This Thread
A_mysql not loading properly - by Duck4coder - 07.01.2014, 18:16
Re: A_mysql not loading properly - by MatriXgaMer - 07.01.2014, 18:18
Re: A_mysql not loading properly - by Duck4coder - 07.01.2014, 18:30
Re: A_mysql not loading properly - by Tayab - 07.01.2014, 19:08
Re: A_mysql not loading properly - by Jstylezzz - 07.01.2014, 19:11
Re: A_mysql not loading properly - by Duck4coder - 07.01.2014, 19:14
Re: A_mysql not loading properly - by sammp - 07.01.2014, 19:19

Forum Jump:


Users browsing this thread: 9 Guest(s)