cannot load account frm mysql?
#1

script
PHP код:
forward OnAccountLoad(playerid);
public 
OnAccountLoad(playerid)
{
    
pInfo[playerid][ID] = cache_get_field_content_int(0"ID");
    
pInfo[playerid][pAdminLevel] = cache_get_field_content_int(0"pAdminLevel");
    
pInfo[playerid][Premium] = cache_get_field_content_int(0"Premium");
    
pInfo[playerid][pEXP] = cache_get_field_content_int(0"pEXP");
    
TogglePlayerSpectating(playeridfalse);
    
GivePlayerMoney(playeridpInfo[playerid][pEXP]);
    
SendClientMessage(playerid, -1"You have successfully logged in.");
    
SpawnPlayer(playerid);
    return 
true;

mysql log
PHP код:
[09:26:03] [DEBUGmysql_format connection1len214format"SELECT * FROM `users` WHERE `Name` = '%e'"
[09:26:03] [DEBUGmysql_tquery connection1query"SELECT * FROM `users` WHERE `Name` = ''"callback"OnAccountLoad"format"i"
[09:26:03] [DEBUGCMySQLQuery::Execute[OnAccountLoad] - starting query execution
[09:26:03] [DEBUGCMySQLQuery::Execute[OnAccountLoad] - query was successfully executed within 0.339 milliseconds
[09:26:03] [DEBUGCMySQLResult::CMySQLResult() - constructor called
[09:26:03] [DEBUGCalling callback "OnAccountLoad"..
[
09:26:03] [DEBUGcache_get_field_content_int row0field_name"ID"connection1
[09:26:03] [ERRORCMySQLResult::GetRowDataByName() - invalid row index ('0')
[
09:26:03] [ERRORcache_get_field_content_int invalid datatype
[09:26:03] [DEBUGcache_get_field_content_int row0field_name"pAdminLevel"connection1
[09:26:03] [ERRORCMySQLResult::GetRowDataByName() - invalid row index ('0')
[
09:26:03] [ERRORcache_get_field_content_int invalid datatype
[09:26:03] [DEBUGcache_get_field_content_int row0field_name"Premium"connection1
[09:26:03] [ERRORCMySQLResult::GetRowDataByName() - invalid row index ('0')
[
09:26:03] [ERRORcache_get_field_content_int invalid datatype
[09:26:03] [DEBUGcache_get_field_content_int row0field_name"pEXP"connection1
[09:26:03] [ERRORCMySQLResult::GetRowDataByName() - invalid row index ('0')
[
09:26:03] [ERRORcache_get_field_content_int invalid datatype
[09:26:03] [DEBUGCMySQLResult::~CMySQLResult() - deconstructor called 
Reply
#2

Are u even sure that the stats save?
Reply
#3

yes, sure,no problem at save stats

PHP код:
[09:17:49] [DEBUGmysql_format connection1len526format"UPDATE `users` SET `pEXP` = '%d', `Premium` = %d, `pAdminLevel` = %d WHERE `Name` = '%s'"
[09:17:49] [DEBUGmysql_tquery connection1query"UPDATE `users` SET `pEXP` = '0', `Premium` = 0, `pAdminLevel` = "callback"(null)"format"(null)"
[09:17:49] [DEBUGCMySQLQuery::Execute[] - starting query execution
[09:17:49] [DEBUGCMySQLQuery::Execute[] - query was successfully executed within 82.333 milliseconds
[09:17:49] [DEBUGCMySQLQuery::Execute[] - no callback specifiedskipping result saving 
Reply
#4

Quote:

query: "SELECT * FROM `users` WHERE `Name` = ''"

No name is being inserted in query as you can see in the red portion.
Check mysql_format line.
Reply
#5

Quote:
Originally Posted by [cS]Owain
Посмотреть сообщение
No name is being inserted in query as you can see in the red portion.
Check mysql_format line.
Yes, i think that he is formatting the string, but forget to put the parameter.

format(s, sizeof(s), "%s");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)