Raised This Month: $ Target: $400
 0% 

SQL Column Issue.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-19-2007 , 13:34   Re: SQL Column Issue.
Reply With Quote #1

What is happening is your while loop for SQL_NumColumns(Query). SQL_NumColumns(Query) only return the numbers of columns from the query. So your while loop will always remain true since SQL_NumColumns(Query) will always return 4 for your 4 columns.

Columns numbers when doing SQL_ReadResult always start from 0. So your incrementing past what is valid.

Code:
    new i = 0     new NumColumns = SQL_NumColumns(Query);     while(SQL_MoreResults(Query))     {         while(NumColumns)         {             SQL_ReadResult(Query,i,output[i],31)             server_print("Found data: %s",output[i])             NumColumns--;             i++         }         SQL_NextRow(Query)     }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
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:19.


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