MySQL Query Problem
#1

Hello i have a problem about a query, i know it's mysql_query but i need the result "instant"

PHP код:
new Cache:csalt,squery[128];
    
mysql_format(SQLsquerysizeof(squery), "SELECT `salt` FROM `users` WHERE `name` = '%e'"GetName(playerid));
    
csalt mysql_query(SQLsquery);
    if(
cache_num_rows() > 0)
    {
        
cache_get_field_content(0"salt"PlayerInfo[playerid][pSalt], SQL);
    }
    
cache_delete(csaltSQL);
    
format(squerysizeof(squery), "Salt: %s",PlayerInfo[playerid][pSalt]);
    print(
squery); 
I try to get the salt from database , but always return as a empty string adn the login system not working becasue there is no salt , how to make this query work?
Reply
#2

If you store the string in enum you need to provide max length of string yourself.
Use this :
Quote:

cache_get_field_content(0, "salt", PlayerInfo[playerid][pSalt], SQL, 256);

Change 256 to whatever max length of salt is, then it should work.
Reply
#3

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
If you store the string in enum you need to provide max length of string yourself.
Use this :

Change 256 to whatever max length of salt is, then it should work.
That i do not know it about provide size for enum arrays, thank you for tell me this, much appreciate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)