[Ajuda] cache_get_row ou cache_get_field_content_int ??
#1

Olб pessoal, tenho uma duvida bastante perturbadora, atualmente eu nгo sei qual dos 2 uso pra carregar dados do banco de dados, alguйm poderia me aconselhar ?? e gostaria de saber o porque tambйm, ficarei grato se alguйm responder.

PHP код:
    new temp[50];
    
cache_get_row(0,10temp);
    
APlayerData[playerid][Senha] = strval(temp); 
OU

PHP код:
APlayerData[playerid][PlayerMoney] = cache_get_field_content_int(0"Money"); 
Reply
#2

O mais atual seria o cache_get_field_content_int, e tambйm melhor.
Reply
#3

Quote:
Originally Posted by pWesley
Посмотреть сообщение
O mais atual seria o cache_get_field_content_int, e tambйm melhor.
Obrigado por responder, eu uso o cache_get_field_content_int pra carregar dados inteiros como score e dinheiro, tenho dificuldade pra carregar strings tipo senha / frases, como devo usar ?
Reply
#4

cache_get_field_content => obtem-se a string
cache_get_field_content_int => retorno inteiro
cache_get_field_content_float => retorno float

Neste caso vocк deve saber o nome da coluna.

Exemplo
PHP код:
cache_get_field_content(0"Senha"APlayerData[playerid][PlayerPassword], *conexгo*, 64);
APlayerData[playerid][PlayerScore] = cache_get_field_content_int(0"Score", *conexгo*);
APlayerData[playerid][StatsMetersDriven] = cache_get_field_content_float(0"Metragem", *conexгo*); 
cache_get_row => obtem-se string
cache_get_row_int => retorno inteiro
cache_get_row_float => retorno float

Neste caso vocк deve saber o valor da coluna no MySQL.

Exemplo
PHP код:
cache_get_row(01APlayerData[playerid][PlayerPassword], *conexгo*, 64);
APlayerData[playerid][PlayerScore] = cache_get_row_int(02, *conexгo*);
APlayerData[playerid][StatsMetersDriven] = cache_get_row_float(03, *conexгo*); 
https://sampwiki.blast.hk/wiki/MySQL/R33
Reply
#5

Acho desnecessбrio salvar os dados da senha em uma variбvel levando em conta que ela nгo serб utilizada para absolutamente nada apуs o login. Uma Dica: Coloque pro Banco de Dados ler a senha e comparar com a que ele digitou apenas na hora do login.
Reply
#6

Quote:
Originally Posted by XandyMello
Посмотреть сообщение
Acho desnecessбrio salvar os dados da senha em uma variбvel levando em conta que ela nгo serб utilizada para absolutamente nada apуs o login. Uma Dica: Coloque pro Banco de Dados ler a senha e comparar com a que ele digitou apenas na hora do login.
Eu tambйm acho desnecessбrio, apenas dei um exemplo para que possam entender oque eu estava querendo, mesmo assim obrigado pela dica.

Quote:
Originally Posted by Locky_
Посмотреть сообщение
cache_get_field_content => obtem-se a string
cache_get_field_content_int => retorno inteiro
cache_get_field_content_float => retorno float

Neste caso vocк deve saber o nome da coluna.

Exemplo
PHP код:
cache_get_field_content(0"Senha"APlayerData[playerid][PlayerPassword], *conexгo*, 64);
APlayerData[playerid][PlayerScore] = cache_get_field_content_int(0"Score", *conexгo*);
APlayerData[playerid][StatsMetersDriven] = cache_get_field_content_float(0"Metragem", *conexгo*); 
cache_get_row => obtem-se string
cache_get_row_int => retorno inteiro
cache_get_row_float => retorno float

Neste caso vocк deve saber o valor da coluna no MySQL.

Exemplo
PHP код:
cache_get_row(01APlayerData[playerid][PlayerPassword], *conexгo*, 64);
APlayerData[playerid][PlayerScore] = cache_get_row_int(02, *conexгo*);
APlayerData[playerid][StatsMetersDriven] = cache_get_row_float(03, *conexгo*); 
https://sampwiki.blast.hk/wiki/MySQL/R33
Obrigado mesmo pela explicaзгo locky, conseguir compreender as funзхes perfeitamente, +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)