Raised This Month: $ Target: $400
 0% 

Question about SQLx


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 09-09-2008 , 22:03   Re: Question about SQLx
Reply With Quote #5

PHP Code:
public client_putinserver(id

    new 
info[32];new _info=get_user_info(id,"*hwID",info,31
    if((!
_info)||(!get_user_flags(id)&&ADMIN_USER)) 
        return 
PLUGIN_HANDLED 
    
new Handle:query=SQL_PrepareQuery(sqlx,"Select `hwid` from `%s` where `hwid`='%s'",table,info
    
SQL_Execute(query)
    while(
SQL_MoreResults(query)) { //execute code as long as you have a result
        //new _col=SQL_FieldNameToNum(query,"hwid") // not needed, _col always 0
        
new buff[32
        
//SQL_ReadResult(query,_col,buff,31)
        
SQL_ReadResult(query,0,buff,31// you only select "hwid", _col = 0
        //if(equali(buff,"")) 
           //return PLUGIN_HANDLED 
        
server_cmd("kick #%d [*myAC] You have been banned from this server.",get_user_userid(id))
        
SQL_NextRow(query//switch to next result
    
}
    
SQL_FreeHandle(query
    return 
PLUGIN_HANDLED 

__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.

Last edited by |PJ| Shorty; 09-09-2008 at 22:10.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
 



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:05.


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