invalid row index ('48')
#1

I have another MYSQL problem i think. So, my server_log.txt doesn't write anything no errors no debugs but i have a mysql_log.html and when i enter i get this

pawn Код:
19:55:14    CMySQLResult::GetRowDataByName()    ERROR   invalid row index ('48')
my server_log.txt looks like this

pawn Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[19:52:57] filterscripts = ""  (string)
[19:52:57]
[19:52:57] Server Plugins
[19:52:57] --------------
[19:52:57]  Loading plugin: crashdetect.so
[19:52:57]   CrashDetect v4.15.1 is OK.
[19:52:57]   Loaded.
[19:52:57]  Loading plugin: streamer.so
[19:52:57]

*** Streamer Plugin v2.7.9 by Incognito loaded ***

[19:52:57]   Loaded.
[19:52:57]  Loading plugin: sscanf.so
[19:52:57]

[19:52:57]  ===============================

[19:52:57]       sscanf plugin loaded.    

[19:52:57]          Version:  2.8.1        

[19:52:57]    (c) 2012 Alex "******" Cole  

[19:52:57]  ===============================

[19:52:57]   Loaded.
[19:52:57]  Loading plugin: mysql.so
[19:52:57]  >> plugin.mysql: R38 successfully loaded.
[19:52:57]   Loaded.
[19:52:57]  Loaded 4 plugins.

[19:52:57]
[19:52:57] Ban list
[19:52:57] --------
[19:52:57]  Loaded: samp.ban
[19:52:57]
[19:52:57]
[19:52:57] Filterscripts
[19:52:57] ---------------
[19:52:57]   Loaded 0 filterscripts.

[19:52:57] Turfs: 48
[19:52:57] 1841 - Objects.
[19:52:57] 17 - Pickups.
[19:52:57] OnGameModeInit Loaded
[19:52:57] Script Loaded - Alex. RPG GFHusi ALPHA
[19:52:57] Number of vehicle models: 121
[19:52:57] Houses: 102
[19:52:57] Bussines: 54
[19:52:57] Dynamic Factions: 14
[19:52:57] Clans: 0
[19:52:57] Cars: 21
[19:52:57] Stocks: 101
[19:55:04] [connection] 89.122.141.95:60480 requests connection cookie.
[19:55:05] [connection] incoming connection: 89.122.141.95:60480 id: 0
[19:55:06] [join] Alex has joined the server (0:89.122.141.95)
[19:55:14] HelloBot: Alex has just logged in.
[19:55:14] HelloBot: Alex has just logged in.
[19:55:14] Alex has been connected to the server (IP: 89.122.141.95).
[19:58:05] SavePlayerData: All player data saved(5 minutes).
So i don't know where is the problem or if this is a problem , i don't get any row in Gamemode or the line in database..
Reply
#2

R39-6 was a special version which prints the query itself.

The most common mistake is in loops, for example i <= rows when the equal sign right there is the problem. Row IDs start from 0, that's why.
Reply
#3

Well now is showing me the errors:

pawn Код:
21:55:48    CMySQLQuery::Execute[]  ERROR   (error #2013) Lost connection to MySQL server during query (Query: "INSERT INTO iplogs (`ip`,`playerid`) VALUES ('MyIP','8')")
pawn Код:
public LogIP(string[],psql)
{
    new query[500];
    mysql_format(SQL,query,500,"INSERT INTO iplogs (`ip`,`playerid`) VALUES ('%s','%d')",string,psql);
    mysql_tquery(SQL,query,"","");
    return 1;
}
and also
pawn Код:
21:55:48    CMySQLResult::GetRowDataByName()    ERROR   invalid row index ('48') (Query: "SELECT * FROM users WHERE `name`='Zlatan' AND `password`='AccountPassword'")
pawn Код:
new qstr[256];
    format(qstr,100,"SELECT * FROM users WHERE `name`='%s' AND `password`='%s'",playername2,password);
    new Cache: pass = mysql_query(SQL,qstr);
Reply
#4

I won't mention non-threaded queries or passwords in plain text and I'll say the most important. Always use cache_delete after a SELECT query otherwise you're going to have problems with memory leak.

Loosing connection to the MySQL server can be due to many reasons.

Can you post the part you call cache_* functions to retrieve the data for the last query?
Reply
#5

Not OP but I got a question.

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Always use cache_delete after a SELECT query otherwise you're going to have problems with memory leak.
Even if it's not saved to a cache? I was under the impression that if I don't use new "Cache:result = mysql_query()" then it wouldn't store the data. Would I still have to delete the cache?
Reply
#6

Quote:
Originally Posted by JordanZaundd
Посмотреть сообщение
Even if it's not saved to a cache? I was under the impression that if I don't use new "Cache:result = mysql_query()" then it wouldn't store the data. Would I still have to delete the cache?
SELECT query needs an active cache to retrieve the data so the 3rd parameter (bool:use_cache) is always set to true and it saves the cache in memory. Afterwards, yes you need to delete the cache from the memory.

In the wiki, it states that cache_delete should be used whenever (bool:use_cache) is set to true so according to this statement, you would have to delete the cache even if you execute an INSERT query, retrieve the ID generated with cache_insert_id I suppose.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)