>>!!SQL!!<<
#1

I have mysql plugin and working sql server on my localhost...
pawn Код:
#define MYSQL_HOST "127.0.0.1"
#define MYSQL_USER "root"
#define MYSQL_PASS ""
#define MYSQL_DB "EFR"
pawn Код:
//OnGameModeInit
samp_mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
    samp_mysql_select_db(MYSQL_DB);
    samp_mysql_close();
This works fine, i receive message that connection to mysql successfull.
I make a table in database called - "IPs".
How to make that on player connect, script insert that players IP adress in my database table IPs? If that IP exists - brake that action and not insert that IP again.
I need to answer in this question and this could be my beginning to the samp + sql
Reply
#2

I haven't got what you want. But if you haven't noticed. You close the mysql in OnGameModeInit.
You just open and close it. (samp_mysql_close()
Reply
#3

Quote:
Originally Posted by MenaceX^
I haven't got what you want. But if you haven't noticed. You close the mysql in OnGameModeInit.
You just open and close it. (samp_mysql_close()
Thats my mistake for closing mysql...
I try to explain what i want again:

I have database "EFR".
I have a table IPs in database "EFR".
When player connect to server his IP inserting in database "EFR" table "IPs".(but if that IP already exists in database "EFR" table "IPs" then it wouldn't been inserting again).

So, how to make this ?
Reply
#4

Do you want to save the player IP when he connects to a server?
Reply
#5

Quote:
Originally Posted by MenaceX^
Do you want to save the player IP when he connects to a server?
I want to save his IP if it doesn't already exists
Reply
#6

Do you have any player enum? You can save the IP to the player enum. When he connects with a new ip, update his new IP.
Reply
#7

Quote:
Originally Posted by MenaceX^
Do you have any player enum? You can save the IP to the player enum. When he connects with a new ip, update his new IP.
No, i dont have Is it deadly needed for writing IP in databse ?
Reply
#8

Quote:
Originally Posted by Dreftas
Quote:
Originally Posted by MenaceX^
Do you have any player enum? You can save the IP to the player enum. When he connects with a new ip, update his new IP.
No, i dont have Is it deadly needed for writing IP in databse ?
I think so..

Because if you could have a player enum or anything to save his IP/update it. It would be much easier..
Reply
#9

I dont even know how to create that enum O_O can you help me ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)