This has to be the strangest bug I've run across. I've been using the mySQL dll and it's been working beautifully. However I can't figure out why this is happening, it makes no sense.

I'm trying to fill up a text object with a list of the currently online users.

You would think this this code would work:
Code:
while(line < users)
{
mySQL_GetStr(txtOnlineUsers.string[line],0,line);
line += 1;
}



However that prints out the same username on every line of text. Sort of. It's hard to describe, but it basically does this: The first line prints the correct name. The second line prints the correct name, but also overwrites the first line with the second name. Etc etc. The end result is that every line contains the last name pulled.

But that isn't the strange part. Trying to debug the code, I tested out this snippet instead of the loop:

Code:
mySQL_GetStr(txtOnlineUsers.string[line],0,line);
line += 1;
mySQL_GetStr(txtOnlineUsers.string[line],0,line);
line += 1;
mySQL_GetStr(txtOnlineUsers.string[line],0,line);
line += 1;
mySQL_GetStr(txtOnlineUsers.string[line],0,line);
line += 1;
//etc etc



THAT works PERFECT. How is that any different than what the loop is doing?! I seriously can't figure it out.



EDIT:
Hmm, did a bunch more tests and the problem is completely unrelated to pulling the string with mySQL_getStr(), so this doesn't really belong in the thread.

That's what I get for being impatient and posting before exhausting all possible tests.

Last edited by Zio; 01/17/06 04:31.