MySQL query fails to set an int (+REP)
#1

Hey guys,
I've been trying to use the following queries when a player logs in / out from the server:

OnPlayerDisconnect()
PHP код:
     new iQuery[1700];
       
mysql_format(MySQLPipelineiQuerysizeof(iQuery), "UPDATE `playerinfo` SET `Online` = 1 WHERE `PlayerName` = '%s'"PlayerName(playerid));
    
mysql_tquery(MySQLPipelineiQuery); 
OnPlayerConnect()
PHP код:
{
    new 
iQuery[1700];
       
mysql_format(MySQLPipelineiQuerysizeof(iQuery), "UPDATE `playerinfo` SET `Online` = 0 WHERE `PlayerName` = '%e'"PlayerName(playerid));
    
mysql_tquery(MySQLPipelineiQuery);

Anywho, it doesn't set the value of Online to 0 when a player connects, tho working fine on a player disconnect.
What's the bug? Please help me <:

+REPing the helper
Reply
#2

OnPlayerDisconnect()
PHP код:
     new iQuery[1700];
       
mysql_format(MySQLPipelineiQuerysizeof(iQuery), "UPDATE `playerinfo` SET `Online` = 1 WHERE `PlayerName` = '%s'"PlayerName(playerid));
    
mysql_query(MySQLPipelineiQuery); 
OnPlayerConnect()
PHP код:
{
    new 
iQuery[1700];
       
mysql_format(MySQLPipelineiQuerysizeof(iQuery), "UPDATE `playerinfo` SET `Online` = 0 WHERE `PlayerName` = '%e'"PlayerName(playerid));
    
mysql_query(MySQLPipelineiQuery);

Reply
#3

Quit re-posting what I already posted. You're not helpful, f* spammer.
Reply
#4

Quote:
Originally Posted by Amit1998
Посмотреть сообщение
Quit re-posting what I already posted. You're not helpful, f* spammer.
anywho I managed to fix it by my own!
Its not a spam check twice before using rude words. You are not seeing your warning I am sure about it

And why you are wasting so much memory? it makes a lag... 1700 for 100chars
Reply
#5

Quote:
Originally Posted by ilijap
Посмотреть сообщение
Its not a spam check twice before using rude words. You are not seeing your warning I am sure about it

And why you are wasting so much memory? it makes a lag... 1700 for 100chars
Your statement is true, but the argument is complete bullshit.
Reply
#6

Quote:
Originally Posted by JasperM
Посмотреть сообщение
Your statement is true, but the argument is complete bullshit.
I read somewhere that big arrays make lag and slower to compile
Reply
#7

Quote:
Originally Posted by ilijap
Посмотреть сообщение
I read somewhere that big arrays make lag and slower to compile
Define what you mean with lag. If someone has a big array my FPS doesn't go down nor does my Ping go up.
Reply
#8

Quote:
Originally Posted by JasperM
Посмотреть сообщение
Your statement is true, but the argument is complete bullshit.
Hoi its you, do you have a solution for me? Seems like, from what I can see via the my_sql log, it doesnt look up for the entire name. For e.g if a player's name is Jasper_AMC then it looks up for Jasper_ in the databases rather than the full name :/
Reply
#9

First of all, if you escape playernames in the disconnect part, than also change this:

PHP код:
UPDATE `playerinfoSET `Online` = 1 WHERE `PlayerName` = '%s' 
To this:

PHP код:
UPDATE `playerinfoSET `Online` = 1 WHERE `PlayerName` = '%e' 
I saw the problem you have before in another topic, but don't know where is was unfortunately. Kind of weird since MySQL normally doesn't cut strings unless there are certain characters in there that are not compatible with the database charset.
Reply
#10

Quote:
Originally Posted by JasperM
Посмотреть сообщение
First of all, if you escape playernames in the disconnect part, than also change this:

PHP код:
UPDATE `playerinfoSET `Online` = 1 WHERE `PlayerName` = '%s' 
To this:

PHP код:
UPDATE `playerinfoSET `Online` = 1 WHERE `PlayerName` = '%e' 
I saw the problem you have before in another topic, but don't know where is was unfortunately. Kind of weird since MySQL normally doesn't cut strings unless there are certain characters in there that are not compatible with the database charset.
hum I found a solution, this wasnt the bug <: ty anyway :
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)