
Originally Posted by
hydramu
i dont whant to restor to lose my settings and more....pfuuu it takes a few hours to delete with mumaker....
there is no exact program which deletes accounts thats the problem , so we suggest u those
or u gotta build ur own SQL Script like
this one
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";
deletes accounts which are inactive for 30 days.
also this the same
PHP Code:
declare @neym nvarchar(10)
DECLARE my_pointer CURSOR FOR SELECT a.memb___id FROM MEMB_INFO a
LEFT JOIN (SELECT DISTINCT AccountID FROM [Character]) b
ON a.memb___id = b.AccountID
WHERE b.AccountID IS NULL
open my_pointer
FETCH NEXT FROM my_pointer INTO @neym WHILE
@@FETCH_STATUS=0
BEGIN
delete from accountcharacter where @neym=id
--delete from extwarehouse where @neym=accountid
delete from memb_info where @neym=memb___id
delete from memb_stat where @neym=memb___id
delete from vi_curr_info where @neym=memb___id
delete from warehouse where @neym=accountid
FETCH NEXT FROM my_pointer INTO @neym
END
close my_pointer
deallocate my_pointer
I think is better add some tables in for delete, because if u delete the account by a editor or what the hell happens with he... he clean everything, if u use the 1.1e u can remove the -- from extwarehouse, or if u wanna see the names of the peoples u are deleting try run just this code:
Code:
SELECT a.memb___id FROM MEMB_INFO a
LEFT JOIN (SELECT DISTINCT AccountID FROM [Character]) b
ON a.memb___id = b.AccountID
WHERE b.AccountID IS NULL
or this
delete from memb_info
where memb___id not in (
select memb___id from memb_stat)
delete from accountcharacter
where id not in (
select memb___id from memb_stat)
delete from character
where accountid not in (
select memb___id from memb_stat)
delete from warehouse
where accountid not in (
select memb___id from memb_stat)
so thats ...