Raised This Month: $ Target: $400
 0% 

MySql Query Fails


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Stylaa
Senior Member
Join Date: Oct 2009
Location: Flensburg, Germany
Old 12-10-2011 , 12:02   MySql Query Fails
Reply With Quote #1

Whit this Code Return is always 1 if the query succeeds.

GetID() is always 1, but in the DB this SteamID is whit id 7

Maybe some1 knows the mistake i have in my code
PHP Code:
public GetID()
{
new 
szTempQuery[512]
        
format(szTempQuery,charsmax(szTempQuery),"SELECT id FROM `stats` WHERE (steamid = 'STEAM_0:1:23456789')")
        return 
ACH_QueryszTempQuery )

PHP Code:

public ACH_QueryszTemp[512] )
    {
        new 
result
        result 
SQL_ThreadQuery(g_Achievement_SqlTuple,"ACH_Query_Handler",szTemp)
        
log_amx("Query Debug : Query Result =  %d !!"result)
        return 
result
    
}
    public 
ACH_Query_Handler(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
    {
        if(
FailState == TQUERY_CONNECT_FAILED)
        {
            
log_amx("Load - Could not connect to SQL database.  [%d] %s"ErrcodeError)
        }
        else if(
FailState == TQUERY_QUERY_FAILED)
        {
            
log_amx("Load Query failed. [%d] %s"ErrcodeError)
        }
    
        new 
result 0
        
        
if(SQL_NumResults(Query) < 1
        {
            
//.FaiL
        
}
        else 
        {
            
// Gefunden
            
result SQL_ReadResult(Query0)
        }
        return 
result
    

__________________

Some People brings Happynes by Coming
Some by Going
Stylaa is offline
Send a message via ICQ to Stylaa
 


Thread Tools
Display Modes

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 12:07.


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