Bug on MYSQL log
#1

Why did i got this error on my mysql.log?
PHP код:
[02/28/18 19:02:05] [ERRORcache_get_value_name_intinvalid row index '0' (number of rows'0') (RP.pwn:4582)
[
02/28/18 19:17:45] [ERRORcache_get_value_name_intinvalid row index '0' (number of rows'0') (RP.pwn:4582
On line:

PHP код:
cache_get_value_int(0"UserID"pInfo[playerid][UserID]); 
From:

PHP код:
if(dialogid == DIALOG_REGISTER) {
    if(!
response) return Kick(playerid);
    if(
response) {
        if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"Please enter a valid password!""Please enter a valid registration password\nTo continue press Register""Register""Quit");
        else {
            
SHA256_PassHash(inputtextHASH_SENHApInfo[playerid][pSenha], 64);
            
GetPlayerIp(playeridipsizeof(ip));
            
mysql_format(ConnectMYSQLquerysizeof(query), "INSERT INTO `accounts` (`Username`, `Senha`, `IP`) VALUES ('%e', '%s', '%s')"GetName(playerid), pInfo[playerid][pSenha], ip);
            
mysql_query(ConnectMYSQL,query);
            
//printf("Dialog register MySQL error: %d", mysql_errno(ConnectMYSQL));
            
pInfo[playerid][Registered] = true;
            
pInfo[playerid][LoggedIn] = true;
            
pInfo[playerid][Cadastrando] = true;
            
Logado[playerid] = 1;
            
GivePlayerMoneyEx(playerid500);
            
SendClientMessage(playeridCOLOR_GREY"Registered Sucess!");
            
cache_get_value_int(0"UserID"pInfo[playerid][UserID]);
            
firstlogin[playerid] = true;
            
OnPlayerLogin(playerid);
            
SetTimerEx("CheckHack"30000"i"playerid);
        }
    }
    return 
1;

Reply
#2

cache_get_value_int(1, "UserID", pInfo[playerid][UserID]);

try 1 number instead of 0...check that
Reply
#3

Quote:
Originally Posted by Jithu
Посмотреть сообщение
cache_get_value_int(1, "UserID", pInfo[playerid][UserID]);

try 1 number instead of 0...check that
PHP код:
[09:04:30] [ERRORcache_get_value_name_intinvalid row index '1' (number of rows'0') (RP.pwn:4589
Reply
#4

bump
Reply
#5

You can try this
pawn Код:
pInfo[playerid][UserID] = cache_insert_id();
https://sampwiki.blast.hk/wiki/MySQL#cache_insert_id
Reply
#6

Show this stock/public.
OnPlayerLogin(playerid);
Reply
#7

You aren't retrieving anything from the database (SELECT) so there is no cache?
Reply
#8

You probably need a query to SELECT from something you do like

Код:
new DB_Query[100];
format(DB_Query, sizeof(DB_Query), "SELECT * FROM `((YOUR TABLE NAME))` WHERE `((YOUR VARIABLE))` = '%d or %s or %f...' LIMIT 1", THE VARIABLE);
mysql_tquery(((Database)), DB_Query);
and then you can use stuff and it should work.
Reply
#9

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
You can try this
pawn Код:
pInfo[playerid][UserID] = cache_insert_id();
https://sampwiki.blast.hk/wiki/MySQL#cache_insert_id
Thank you! +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)