Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / MySQL - Cattlerustler V2

Author
Message
Blue Dragon
19
Years of Service
User Offline
Joined: 21st Oct 2005
Location:
Posted: 14th Jan 2007 18:58 Edited at: 14th Jan 2007 19:02
Howdy CR! (again)
I've been posting too much lately, I know. But I'm working on a major project now using all SORTS of goodies - networking and MySQL among them. Anyway, I seem to have your MySQL plugin setup fine - I can read data from MySQL and already know I can write to it too. However, the program crashes at a point that - as far as I can tell - I'm not doing anything too bizarre. I'll post the relevant code here:



It's dying at the 4th from the bottom line: r$=MySQL_GetWholeRow(z, "*"). If I comment that line out it runs ok. Also numrows stays -1 as it should until the query catches a valid row. Then it goes to 0 so there SHOULD be valid data in there. Am I missing something basic here? It should be noted I use essentialy similar code to look up another table at the VERY start of this program and that works fine. Do I need to reset something between running a MySQL_GetWholeRow() command perhaps?

Signatures are a waste of bytes.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Jan 2007 19:24
Quote: "Do I need to reset something between running a MySQL_GetWholeRow() command perhaps?"

not that I can think of, resets of params between sproc calls was needed but that doesnt apply here.

Your code seems all fine, the only thing I can think of is your Query isnt returning the data you expect, or the variable U is not what you expect or some other variable may not be out of scope and is retaining an old value possibly. Its hard to tell. Plus its inside a nested if with a timer condition, so that may add to the possible confusion too. Are you able to somehow step-debug it?

Sorry if this sounds vague but its hard to tell whats going on. See if you can somehow debug it in your ide, or worst case throw some text to a file as it runs.

Blue Dragon
19
Years of Service
User Offline
Joined: 21st Oct 2005
Location:
Posted: 18th Jan 2007 02:01
Gotcha. I'll check it out and see what I can find.

That particular code is part of a watchdog routine I'm running to see if a client disconnects. Yesterday I kinda realized that its also totally unnecessary to save when the client last checked in to the database. Just a variable should do just fine. After all, if the server program dies it really wont care much if the clients do too.

Of course, I'll be doing more database lookups elsewhere in the code so I may need to revisit this - but if the variables and/or code around it is the problem it's about to be changed anyway.

I still wonder why you guys do all this for us, but your work is SURE appreciated - personally I think TGC would be well advised to incorporate some of these third party features directly. It sure expands the use of DBP! Thanks again.

Signatures are a waste of bytes.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jan 2007 03:19
no problem, sorry I couldnt help more decisively - keep me posted on what happens with this

Quote: "I still wonder why you guys do all this for us, but your work is SURE appreciated"

Speaking for myself, I like to code and like to be able to fill in for a non-existent feature in the base language if another user will find it useful.

Quote: "personally I think TGC would be well advised to incorporate some of these third party features directly. It sure expands the use of DBP!"

Some they have, most they wont. They have us for that

Anyway, cheers

Login to post a reply

Server time is: 2024-11-22 17:18:28
Your offset time is: 2024-11-22 17:18:28