Is this thing possible ? I give rep++ (MYSQL)
#3

yes, possible, but first, you have to create a variable for each one.
pawn Код:
new c1, c2; // creating connection handle for each one.
now after creating a variable for each one, we will connect to them when server starts, and define the variables:
pawn Код:
public OnGameModeInit()
{
     c1 = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password); // this is for server database
     c2 = mysql_connect(mysql_host2, mysql_user2, mysql_database2, mysql_password2); // this is for forum db.
     return 1;
}
however, in queries, you should determine the connection handle for each db, example:
pawn Код:
public OnPlayerConnect(playerid)
{
   new name[32]; // an example
   GetPlayerName(playerid, name, sizeof name); // an example
   mysql_tquery(c1, "SELECT `Password` FROM `players` WHERE `name`='%s' LIMIT 1", "CheckPlayer", "i", playerid);
   return 1;
}
as you see in mysql_tquery function, first parameter (the connection handle was c1) be cause we want to execute the query in the "players" database which we defined, we would use c2 for the forum db query.
Reply


Messages In This Thread
Is this thing possible ? I give rep++ (MYSQL) - by buburuzu19 - 10.06.2015, 05:11
Re: Is this thing possible ? I give rep++ (MYSQL) - by GTLS - 10.06.2015, 05:50
Re: Is this thing possible ? I give rep++ (MYSQL) - by Sawalha - 10.06.2015, 07:11
Re: Is this thing possible ? I give rep++ (MYSQL) - by Vince - 10.06.2015, 08:13
Re: Is this thing possible ? I give rep++ (MYSQL) - by buburuzu19 - 10.06.2015, 09:18
Re: Is this thing possible ? I give rep++ (MYSQL) - by buburuzu19 - 10.06.2015, 09:20

Forum Jump:


Users browsing this thread: 1 Guest(s)