Raised This Month: $ Target: $400
 0% 

Solved SQL Database


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
sky_pg
Member
Join Date: Apr 2012
Old 01-28-2017 , 12:41   Re: SQL Database
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
You would do:
Code:
SELECT * FROM `global_stats` WHERE `timestamp` < '%d';

OR

SELECT Field1, Field2, Field3 FROM `global_stats` WHERE `timestamp` < '%d';
In your query handler (IgnoreHandle) you would then read the results and write to log file.
im not sure im i geting it right..

PHP Code:
SQL_ThreadQuery(g_SqlTuple"displayFunction""SELECT * FROM `global_stats` WHERE `timestamp` < '%d';"); 
PHP Code:
public displayFunction(failStateHandle:QueryError[], errorIdData[], dataSizeFloat:queueTime)
{
        
// Only reach here if there is no connection or invalid query
    
if (failState || errorId || Error[0])
                
log_amx("SQL_ThreadQuery Failed! FailState = %d | Error = %s | errorId = %d"failStateErrorerrorId);
 
        else
        {
        if (
SQL_NumRows(Query))
        {
                        
// Stress results
                        
while (SQL_MoreResults(Query))
                        {
                                new 
Name[512];
                                
SQL_ReadResult(Query0Namecharsmax(Name));
            
log_to_file("addons/amxmodx/logs/deleted.log","%s",Name)
                                
SQL_NextRow(Query);
                        }
 
                        
// Rewind from zero
                        
SQL_Rewind(Query);
 
                        
// Stress again
                        
while (SQL_MoreResults(Query))
                        {
                                new 
Name[512];
                                
SQL_ReadResult(Query0Namecharsmax(Name));
 
                                
SQL_NextRow(Query);
 
                                
// Print
                                
server_print(Name);
            
log_to_file("addons/amxmodx/logs/deleted.log","%s",Name)
                        }
                }
 
                
// Get field's name
                
new fieldName[512];
                
SQL_FieldNumToName(Query0fieldNamecharsmax(fieldName));
 
                
server_print(fieldName);
        
log_to_file("addons/amxmodx/logs/deleted.log","%s",fieldName)
        }



result>
PHP Code:
L 01/28/2017 18:36:04steamid-name 

Last edited by sky_pg; 01-28-2017 at 12:41.
sky_pg 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 20:53.


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