Script to delete 30 days old account and inactive accounts Season IV

Results 1 to 5 of 5
  1. #1
    Member darknessgod_565 is offline
    MemberRank
    Jul 2008 Join Date
    58Posts

    Script to delete 30 days old account and inactive accounts Season IV

    Am using season 4 files can anyone give me some advice on how to do this?


  2. #2
    Proficient Member phit666 is offline
    MemberRank
    Apr 2007 Join Date
    197Posts

    Re: Script to delete 30 days old account and inactive accounts Season IV

    Here is a simple php script...

    PHP Code:
    mssql_connect("host","user","pass");

    // if your account tables (MEMB_STAT, MEMB_INFO) is in muonline
    mssql_select_db("muonline");
     
    $q mssql_query("select memb___id,DisConnectTM from MEMB_STAT where ConnecStat=0");

    for(
    $i=0$i mssql_num_rows($q); $i++)
    {
    $d mssql_fetch_row($q);

    // get total seconds of 30 days
    $days30 60*60*24*30;

    // get last disconnect time in seconds
    $lastdc strtotime($d[1]);

       
    // check if current time is 30 days greater than last dc
       
    if((time()-$lastdc) > $days30)
       {
       
    // delete account
       
    mssql_query("delete from MEMB_INFO where memb___id='".$d[0]."'");
       
    // delete characters
       
    mssql_query("delete from characters where AccountId='".$d[0]."'");
       
    // delete list in AccountCharacter table
       
    mssql_query("delete from AccountCharacter where ID='".$d[0]."'");
       
    // delete from MEMB_STAT
       
    mssql_query("delete from MEMB_STAT where memb___id='".$d[0]."'");
       }
    }
    echo 
    "Done"

  3. #3
    Member vailoelle is offline
    MemberRank
    Apr 2007 Join Date
    63Posts

    Re: Script to delete 30 days old account and inactive accounts Season IV

    If you need SQL Script look here http://forum.ragezone.com/f196/guide...-admin-353278/

    or use this

    delete account with nomore connect from 2007-06-01


    Code:
    delete from memb_info
    where memb___id in (
    select memb___id from memb_stat where disconnecttm<'2007-06-01')
    
    delete from accountcharacter
    where id in (
    select memb___id from memb_stat where disconnecttm<'2007-06-01')
    
    delete from character
    where accountid in (
    select memb___id from memb_stat where disconnecttm<'2007-06-01')
    
    delete from warehouse
    where accountid in (
    select memb___id from memb_stat where disconnecttm<'2007-06-01')
    GL
    Last edited by vailoelle; 02-01-10 at 12:56 PM.

  4. #4
    Member darknessgod_565 is offline
    MemberRank
    Jul 2008 Join Date
    58Posts

    Re: Script to delete 30 days old account and inactive accounts Season IV

    Thank you very much ^^

    ill test them ^^

  5. #5
    Member darknessgod_565 is offline
    MemberRank
    Jul 2008 Join Date
    58Posts

    Re: Script to delete 30 days old account and inactive accounts Season IV

    i get SQL error msg

    Code:
    Server: Msg 446, Level 16, State 9, Line 5
    Cannot resolve collation conflict for equal to operation.



Advertisement