Raised This Month: $ Target: $400
 0% 

sqlx my code wrong ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DaniDin
Member
Join Date: Oct 2008
Old 12-26-2008 , 10:15   sqlx my code wrong ?
Reply With Quote #1

hi i have db and table with the name "tbname" and column "name"
when i do this
PHP Code:
public client_disconnect(id)
    
SQL_ThreadQuery(g_SqlTuple,"SelectHandle","SELECT name FROM tbname WHERE id='1'")

    
public 
SelectHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
    if(
FailState == TQUERY_CONNECT_FAILED)
        return 
set_fail_state("Could not connect to SQL database.")
    else if(
FailState == TQUERY_QUERY_FAILED)
        return 
set_fail_state("Query failed.")
   
    if(
Errcode)
        return 
log_amx("Error on query: %s",Error)
   
    new 
DataNum
    
while(SQL_MoreResults(Query))
    {
        
DataNum SQL_ReadResult(Query,0)
       
        
server_cmd("amx_say your name is %d ",DataNum)
    
        
SQL_NextRow(Query)
    }
   
    return 
PLUGIN_CONTINUE

i get like this : your name is 0
but i have the name "loler"
and i want that print this "Your name is loler"
DaniDin 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 09:16.


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