Raised This Month: $51 Target: $400
 12% 

SQL ReadResult Multi results


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheKidz
Senior Member
Join Date: May 2009
Old 01-30-2012 , 17:44   SQL ReadResult Multi results
Reply With Quote #1

PHP Code:
formatexgCachecharsmaxgCache ),"SELECT `name` FROM `%s`.`players` WHERE (`players`.`name` = '%s')"SQL_DBszArgs )     
SQL_ThreadQuerySQL_Tuple"GetName"gCacheData); 

Everything is right, but when i try to get those results i got error in column.

if i do like this
PHP Code:
SQL_ReadResultQuery0szQueryResultcharsmaxszQueryResult ) ); 
it works with only 1 item inside the table, but when i got 2 or more i got column error. Any1 know whats the problem ? ):
__________________
TheKidz is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-30-2012 , 17:46   Re: SQL ReadResult Multi results
Reply With Quote #2

Because you are getting multiple rows with 1 column.

Use SQL_MoreResults() and SQL_NextRow() to get all of the results.
Need more info? Check out the SQLx tutorial from Hawk552.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-30-2012 , 17:48   Re: SQL ReadResult Multi results
Reply With Quote #3

Do you use while( SQL_NumResults( Query ) ) ?

PS: Exolent won me 2 seconds u.u , btw , if you want any code to look , check my miniduel system.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 01-30-2012 at 17:49.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-30-2012 , 18:06   Re: SQL ReadResult Multi results
Reply With Quote #4

Quote:
Originally Posted by lucas_7_94 View Post
while( SQL_NumResults( Query ) )
Nice infinite loop you've got there.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-30-2012 , 18:22   Re: SQL ReadResult Multi results
Reply With Quote #5

I'm try to say sawse if he use a loop to get the data , to evite the infinite loop use SQL_NextRow( Query )
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-30-2012 , 18:48   Re: SQL ReadResult Multi results
Reply With Quote #6

Quote:
Originally Posted by lucas_7_94 View Post
I'm try to say sawse if he use a loop to get the data , to evite the infinite loop use SQL_NextRow( Query )
That won't fix your infinite loop. You have to use SQL_MoreResults().
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-30-2012 , 18:56   Re: SQL ReadResult Multi results
Reply With Quote #7

oh yes , sorry , i'm confused at the names lol
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
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 03:33.


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