Loading MYSQL problem
#1

Hello i have a problem loading mysql :
PHP код:
iJoueur[playerid][Argent] = cache_get_field_content_int(0"argent");
printf("%d $",iJoueur[playerid][Argent]); 
server log : 0 $
but :

you can help me ?

PS : Sorry for mi bad english, i am french.
Reply
#2

Any errors in mysql_log.txt?
Reply
#3

Translate French to English

Cyka Blyat xD

Reply
#4

[21:10:04] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `comptes` SET `argent` = %d WHERE `ID` = %d"
[21:10:04] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `comptes` SET `argent` = 0 WHERE `ID` = 7", callback: "(null)", format: "(null)"
[21:10:04] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[21:10:04] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 4.989 milliseconds
[21:10:04] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
[21:10:07] [DEBUG] CMySQLConnection:isconnect - connection was closed
[21:10:07] [DEBUG] CMySQLHandle::~CMySQLHandle - deconstructor called
[21:10:23] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[21:10:23] [DEBUG] CMySQLHandle::Create - creating new connection..
[21:10:23] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[21:10:23] [DEBUG] CMySQLHandle::Create - connection created (id: 1)
[21:10:23] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:10:23] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:10:23] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:10:23] [DEBUG] mysql_errno - connection: 1
[21:10:23] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:10:23] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:10:23] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:10:23] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:10:23] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:10:23] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:10:23] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:10:23] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:10:23] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:10:48] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1"
[21:10:48] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = 'Malcom Saka", callback: "VerificationCompte", format: "i"
[21:10:48] [DEBUG] CMySQLQuery::Execute[VerificationCompte] - starting query execution
[21:10:48] [DEBUG] CMySQLQuery::Execute[VerificationCompte] - query was successfully executed within 0.880 milliseconds
[21:10:48] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[21:10:48] [DEBUG] Calling callback "VerificationCompte"..
[21:10:48] [DEBUG] cache_get_data - connection: 1
[21:10:48] [DEBUG] cache_get_field_content - row: 0, field_name: "pass", connection: 1, max_len: 66
[21:10:48] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "pass", data: "473656B6EB2594B968C6B918B8923F010681EDBCBE83EB7D0 403256402364433"
[21:10:48] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1
[21:10:48] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "7"
[21:10:48] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[21:10:54] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1"
[21:10:54] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `comptes` WHERE `pseudo` = 'Sakafay' LIMIT 1", callback: "ChargerCompte", format: "i"
[21:10:54] [DEBUG] CMySQLQuery::Execute[ChargerCompte] - starting query execution
[21:10:54] [DEBUG] CMySQLQuery::Execute[ChargerCompte] - query was successfully executed within 0.310 milliseconds
[21:10:54] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[21:10:54] [DEBUG] Calling callback "ChargerCompte"..
[21:10:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "argent", connection: 0
[21:10:54] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:10:54] [ERROR] cache_get_field_content_int - invalid datatype
[21:10:54] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
Reply
#5

Quote:

CMySQLResult::GetRowDataByName() - invalid row index ('0')

There's your problem. Your query probably didn't return any rows.
Reply
#6

How to do ?
Reply
#7

Quote:
Originally Posted by Skinnz
Посмотреть сообщение
Hello i have a problem loading mysql :
PHP код:
iJoueur[playerid][Argent] = cache_get_field_content_int(0"argent");
printf("%d $",iJoueur[playerid][Argent]); 
server log : 0 $
but :

you can help me ?

PS : Sorry for mi bad english, i am french.
PHP код:
new Cache:result;
result mysql_query(MySQL"SELECT * FROM `YOUR TABLE NAME`");
iJoueur[playerid][Argent] = cache_get_field_content_int(0"argent"); 
printf("%d $",iJoueur[playerid][Argent]);
cache_delete(result); 
Reply
#8

I found the error with your help, she had :

mysql_format(mysql, requete, sizeof(requete), "SELECT * FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1", Nom); // On prend la ligne ou le nom est йgal au nom du joueur

"Nom" have no setting

Thank you
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)