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_Query( szTempQuery )
}
PHP Code:
public ACH_Query( szTemp[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", Errcode, Error)
}
else if(FailState == TQUERY_QUERY_FAILED)
{
log_amx("Load Query failed. [%d] %s", Errcode, Error)
}
new result = 0
if(SQL_NumResults(Query) < 1)
{
//.FaiL
}
else
{
// Gefunden
result = SQL_ReadResult(Query, 0)
}
return result
}
__________________