MySQL - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL (
/showthread.php?tid=250277)
MySQL -
Pooh7 - 22.04.2011
Is it possible to connect Windows server with MySQL server if that MySQL server is on Linux?
Re: MySQL -
Alby Fire - 22.04.2011
Yes, it is, the database's host doesn't prevent the connection with the server.
Re: MySQL -
Raimis_R - 22.04.2011
DELETED
Re: MySQL -
Pooh7 - 22.04.2011
Ok, I have a problem...
I made a script for connecting to database and checking if player's account exists in database.
And it doesn't work.
pawn Code:
stock SpojiSeSaBazom()
{
if(mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS)) print("Spajanje sa MySQL bazom je uspesno!"); // if is succsessful
else print("Spajanje sa MySQL bazom nije uspelo..."); // if is unsuccessful
}
public OnPlayerConnect(playerid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime, sizeof ime);
new string[64];
format(string, sizeof(string), "SELECT * FROM Igraci WHERE Ime = '%s'", ime);
mysql_query(string);
mysql_store_result();
if(mysql_num_rows() != 0) SendClientMessage(playerid, 0xFFFFFFFF, "Your account exists in database!");
else SendClientMessage(playerid, 0xFFFFFFFF, "Your account doesn't exists in database!");
}
I get message "Your account exists in database!" every time, but my account doesn't exists, database is clear.
When I make account, I get "Your account exists in database!" again.
What is the problem? It's my first time to work with MySQL...
Re: MySQL -
Pooh7 - 23.04.2011
refresh
Re: MySQL -
MadeMan - 23.04.2011
Did you check mysql logs?