Raised This Month: $ Target: $400
 0% 

Solved SQL Database


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sky_pg
Member
Join Date: Apr 2012
Old 01-27-2017 , 19:38   SQL Database
Reply With Quote #1

hi all

i have this code to cleanup old entries in my database
PHP Code:
public CleanDataBase()
{
    new 
curTime get_systime();
    
curTime -= ((30 24) * 3600);
    
    new 
szTemp[512]
    new 
ErrorCode,Handle:SqlConnection SQL_Connect(g_SqlTuple,ErrorCode,g_Error,charsmax(g_Error))
    if(
g_SqlTuple == Empty_Handle)
        
set_fail_state(g_Error)
    
formatex(szTemp,charsmax(szTemp),"DELETE FROM `global_stats` WHERE `timestamp` < '%d';"curTime);    
    
    
SQL_ThreadQuery(g_SqlTuple,"IgnoreHandle",szTemp)
    
SQL_FreeHandle(SqlConnection)

how can i see whole info aboute this entry? (steamid-name) for example
this is my table
PHP Code:
Queries SQL_PrepareQuery(SqlConnection,"CREATE TABLE IF NOT EXISTS global_stats (`steamid-name` varchar(32), xp TEXT(11), level INT(11), `timestamp` INT(10) NOT NULL DEFAULT 0, name varchar(32))"
point of this is i want to log deleted entries

Last edited by sky_pg; 01-28-2017 at 13:44.
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