- Joined
- Jul 18, 2008
- Messages
- 23
- Reaction score
- 1
Am using season 4 files can anyone give me some advice on how to do this?
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";
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')
Server: Msg 446, Level 16, State 9, Line 5
Cannot resolve collation conflict for equal to operation.