Raised This Month: $ Target: $400
 0% 

Question about SQLx


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 09-09-2008 , 21:33   Re: Question about SQLx
Reply With Quote #3

Quote:
what you show me from your code is not enough to say something.
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)
    new 
_col=SQL_FieldNameToNum(query,"hwid")
    new 
buff[32]
    
SQL_ReadResult(query,_col,buff,31)
    if(
equali(buff,""))
        return 
PLUGIN_HANDLED
    server_cmd
("kick #%d [*myAC] You have been banned from this server.",get_user_userid(id))
    
SQL_FreeHandle(query)
    return 
PLUGIN_HANDLED

Quote:
you donīt check if you got a result before you read the result.
How i can do it?
Please, if not hard, can you give me a correct part of code with it?

Last edited by TheRadiance; 09-09-2008 at 21:37.
TheRadiance is offline
Send a message via ICQ to TheRadiance
 



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