Raised This Month: $ Target: $400
 0% 

SQL_ReadResult to read string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 05-24-2016 , 14:19   SQL_ReadResult to read string
Reply With Quote #1

Hello,

I have the follwing query:
"formatex( strQuery, charsmax( strQuery ), "SELECT Salt FROM Player WHERE ( Player.SteamID = %s )", strPlayerAuthID );"

Now if I understand MySQL correctly, this should return the string called Salt of that player. My question is, how do I go about to read that result?

I saw this in the include files:
Code:
/**
 * Retrieves the current result.
 * A successful query starts at the first result,
 *  so you should not call SQL_NextRow() first.
 * Passing no extra params - return int
 * Passing one extra param - return float in 1st extra arg
 * Passing two extra params - return string in 1st arg, max length in 2nd
 * Example:
 *  new num = SQL_ReadResult(query, 0)
 *  new Float:num2
 *  new str[32]
 *  SQL_ReadResult(query, 1, num2)
 *  SQL_ReadResult(query, 2, str, 31)
 */
native SQL_ReadResult(Handle:query, column, any:...);
My query does not return a row, but rather a single entry (the string salt), so I should do the following correct? Correct me if I am wrong please.
Code:
SQL_ReadResult( hQuery, 0, strSalt, charsmax( strSalt ) );
Thank you!
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]
tonykaram1993 is offline
 



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 18:43.


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