SA-MP Forums Archive
Little Help - 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: Little Help (/showthread.php?tid=525960)



Little Help - Sanady - 14.07.2014

Hello everybody. I have problem when I type /oban everything is getting load except IP I don`t know why but only IP from user table won`t load. Here is query check please:
pawn Код:
SELECT * FROM `users` WHERE `UserName` = '%s' AND `IP` = '%s'



Re : Little Help - ManuelNeuer - 14.07.2014

pawn Код:
new IP[16];
GetPlayerIp(playerid, IP, 16);
pawn Код:
SELECT * FROM `users` WHERE `UserName` = '%s' AND `IP` = '%s', puser, IP);



Re: Re : Little Help - Sanady - 14.07.2014

Quote:
Originally Posted by ManuelNeuer
Посмотреть сообщение
pawn Код:
new IP[16];
GetPlayerIp(playerid, IP, 16);
pawn Код:
SELECT * FROM `users` WHERE `UserName` = '%s' AND `IP` = '%s', puser, IP);
Hmm sorry it`s going with offline ban system. I want to get IP from mySQL table but everything get`s loaded except IP from Table I can`t use playerid becouse that player is not online.


Re: Little Help - azzerking - 14.07.2014

First, you need to check whether >> IP << is the correct spelling for the IP in the MYSQL Database.

If the table column name is not the right spelling then it will not load it.

Also, could you specify how you are loading them? what MYSQL plugin are you using and the version. Maybe include the lines this query is being run off.


Re: Little Help - Sanady - 14.07.2014

Quote:
Originally Posted by azzerking
Посмотреть сообщение
First, you need to check whether >> IP << is the correct spelling for the IP in the MYSQL Database.

If the table column name is not the right spelling then it will not load it.

Also, could you specify how you are loading them? what MYSQL plugin are you using and the version. Maybe include the lines this query is being run off.
Everything is checked and guess what everything is correct but still have same problem..


Re: Little Help - Stanford - 14.07.2014

Try something like this:

pawn Код:
format(query,sizeof(query), "SELECT `id`,`IP` FROM `accounts` WHERE `Username`='%s'", tmpName);
        mysql_function_query(lineserver, query, true, "banningipforplayer", "i", playerid);



Re: Little Help - azzerking - 14.07.2014

Can you list the the column name for IP, and tell us your mysql plugin.

and how are you extracting it from database?

for example using BlueG plugin R36, then using cache_get_field_content.

Are you sure that IP in your database is a Varchar of 15. and that the variable your loading it into is also 15 cells

pawn Код:
new ip[15];

// MYSQL QUERY HERE //
cache_get_field_content(i, "COLUMN_NAME_HERE", ip);
Is this how you are doing it?


Re: Little Help - Sanady - 14.07.2014

Quote:
Originally Posted by azzerking
Посмотреть сообщение
Can you list the the column name for IP, and tell us your mysql plugin.

and how are you extracting it from database?

for example using BlueG plugin R36, then using cache_get_field_content.

Are you sure that IP in your database is a Varchar of 15. and that the variable your loading it into is also 15 cells

pawn Код:
new ip[15];

// MYSQL QUERY HERE //
cache_get_field_content(i, "COLUMN_NAME_HERE", ip);
Is this how you are doing it?
Well I am using MySQL R7 version and First I am selecting everything from table users then I search for column which have name UserName and IP when I found these two then I insert into bans table banname and banip that`s how it`s works...