Raised This Month: $ Target: $400
 0% 

[Solved]Plugin says: Query failed.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 12-30-2011 , 17:55   [Solved]Plugin says: Query failed.
Reply With Quote #1

PHP Code:
#define TABLE_NAME "Statics"
#define KEY_TODAYVISITS "Today_Visits"
#define KEY_MOSTVISITS "Most_Visits"
#define KEY_TOTALVISITS "Total_Visits"
#define KEY_UPTIME "Total_Uptime"
#define KEY_KILLS "Kills"
#define KEY_DEATHS "Deaths"

/*<snippet>*/
formatex(query255"UPDATE %s SET %s = '%d', %s = '%s', %s = '%i', %s = '%i', %s = '%i', %s = '%i');",\
    
TABLE_NAME,\
    
KEY_TODAYVISITSstr_to_num(szToday),\
    
KEY_MOSTVISITSszMost,\
    
KEY_TOTALVISITSTotalVisits,\
    
KEY_UPTIMETotal_Time,\
    
KEY_KILLSTotal_Kills,\
    
KEY_DEATHSTotal_Deaths
    
);
    
    
SQL_ThreadQuery(g_sql_tuple"QueryWriteData"query);
/*</snippet>*/
public QueryWriteData(failstateHandle:queryerror[], errcodedata[], datasizeFloat:queuetime)
{
    if( 
failstate == TQUERY_CONNECT_FAILED )
    {
        
set_fail_state("Could not connect to database.");
    }
    else if( 
failstate == TQUERY_QUERY_FAILED )
    {
        
set_fail_state("Query failed.");
    }
    else if( 
errcode )
    {
        
log_amx("Error on query: %s"error);
    }

Code:
[AMXX] Plugin says: Query failed.
Run time error 1: forced exit 
[AMXX] [0] QueryWriteData (line 189)
Am new to SQL and I can't find the error.


EDIT: Just saw the bracket.

Last edited by SpeeDeeR; 12-30-2011 at 17:59.
SpeeDeeR is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-31-2011 , 04:42   Re: [Solved]Plugin says: Query failed.
Reply With Quote #2

Quote:
"UPDATE %s SET %s = '%d', %s = '%s', %s = '%i', %s = '%i', %s = '%i', %s = '%i');"
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Reply



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 02:58.


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