Raised This Month: $ Target: $400
 0% 

SQLX


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Drak
Veteran Member
Join Date: Jul 2005
Old 02-16-2007 , 22:17   Re: SQLX
Reply With Quote #4

Code:
public is_user_registered(id) {     if(!g_SqlConnection) { // We lost connection, don't continue.         return 0     }     new authid[33]     get_user_authid(id,authid,32)     //format(query,255,"SELECT steamid FROM main WHERE steamid='%s'",authid)     new Handle:Query = SQL_PrepareQuery(g_SqlConnection,"SELECT steamid FROM main WHERE steamid='%s'",authid)     if(!SQL_Execute(Query))     {         // if there were any problems         SQL_QueryError(Query,g_error,511)         set_fail_state(g_error)     }     // checks to make sure there's more results     // notice that it starts at the first row, rather than null     new Data     while(SQL_MoreResults(Query))     {         Data = SQL_ReadResult(Query,0)         SQL_NextRow(Query)         console_print(0,"[AMXX SQL] Your SteamID: %s Matched with the SQL SteamID: %s",authid,Query)         SQL_FreeHandle(Query)         return 1     }     return 0     //SQL_FreeHandle(g_SqlConnection) }
This seemed to work, but I still am clueless on some parts. Like, is it necessary to close the connection after the Query is complete?
Drak is offline
Send a message via MSN to Drak
 



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 00:34.


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