mysql - store result.
#1

Hi, i have some questions.

When i load player data, i have do about 7 mysql_store_result. ofcourse i do mysql_free_result. But, if some player will spawn at the same time, can crash server, because too much store result is called?
Reply
#2

I don't quite know why you're using mysql_store_result() 7 times. That's just utterly pointless. You should be doing a loop like while(mysql_fetch_row_format(string, "|")) and using sscanf to extract the data if you aren't using threaded queries (which I know you're not due to the functions you're using).

Switching to threaded queries makes everything 20x easier in my opinion, plus they're a bit faster since they have the caching function!
Reply
#3

I use debian-6 OS. Don't care what OS is?
Reply
#4

I have a lot of thins to load, and i can't it store in one line..
Reply
#5

Well this is what i have in my script.
pawn Код:
SetTimer("Free",100,1);
forward Free();
public Free()
{
    mysql_store_result();
    mysql_free_result();
}
One disadvantage it does is it will spam the crap out of your mysql debug if you have it enabled. I once had bugs which crashed my server because of mysql but when i did the thing above, it stop crashing.
Reply
#6

If you need to resort to "hacks" to get things working then you're doing something seriously wrong.
Reply
#7

How to possible, to load data from mysqldatabase, with one mysql_store_result, when i have about 200 things, to load? because i use a lot of loading, because i want to load a lot of things.
Reply
#8

I think it's something like this...

pawn Код:
new
    szQuery[500];

mysql_store_result();

while(mysql_fetch_row_format(szQuery, "|"))
{
    sscanf(szQuery, "e<p<|>dds[92]dddddffffffffs[128]ddddfffff", LargeArrayVariableHere[argument1]);
   
    // data is loaded into LargeArrayVariableHere
}
Quite frankly, if you didn't know that you shouldn't be using MySQL. You're using it completely incorrectly and you're only hurting yourself and your script in the long run. Go back to files, or teach yourself something before using MySQL.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)