Raised This Month: $ Target: $400
 0% 

SQLx to global variable problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lunarwolfx
Member
Join Date: Feb 2005
Old 01-07-2007 , 20:34   Re: SQLx to global variable problem
Reply With Quote #1

To pass a player's id into the function.

Add this

Code:
new data[2]; format(data,1,"%d",id) SQL_ThreadQuery(SQL_Tuple,"QueryHandle",Query,data,1)

Then in your Query Handle, put this somewhere after the error checking:

Code:
new id = str_to_num(data)

and you now have the id of the player.

And try putting SQL_ResultInt=number inside your loop instead of after it.

Last edited by lunarwolfx; 01-07-2007 at 20:37.
lunarwolfx is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-07-2007 , 21:39   Re: SQLx to global variable problem
Reply With Quote #2

Actually, I forgot to mention that I had SQL_ResultInt inside the loop instead of outside of the loop and it still gave the wrong results. One strange thing to note is the fact that when I printed out ResultInt inside of the SQL function, it returned 250, the number I assigned to Number before the loop.

Anyway, thanks for showing me how to pass things in. Hopefully I won't have anymore problems... I'm going to go ahead and remove the loop, seeing as it's causing some problems... and I'm not trying to retrieve more than one piece of data at a time.

THANK YOU SO MUCH... I have been waiting for a response for quite some time.

Where is the documentation on SQLx other than Hawk's tutorial? I heard Bailopan wrote something about it, but the only help I got from bail was when I read inside of SQLx.inc...

[Edit] Oh, and data[] would have to be size [3], because some id's are two digits long...

Also, can you keep adding data to the end of the threadquery function, such as two player id's at once?

Last edited by Bad_Bud; 01-08-2007 at 00:07.
Bad_Bud is offline
lunarwolfx
Member
Join Date: Feb 2005
Old 01-08-2007 , 00:33   Re: SQLx to global variable problem
Reply With Quote #3

you can, but you'll have to parse it.

As far as documentation goes, the best I found was hawk's tutorial.

and thx for the heads up about the length.
lunarwolfx is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode