Hello,
Please help me command deleted all account banned 253 in mssql
thanks.
Hello,
Please help me command deleted all account banned 253 in mssql
thanks.
Can you please explain yourself better?
Save this file in PHP and run on your website.PHP Code:<?
//Script By Gaspar
include "your_config.php";
$busca1 = mssql_query("SELECT TOP 99999 AID FROM Account WHERE UGradeID = '253'");
while($busca2 = mssql_fetch_row($busca1)){
$delete1 = mssql_query("DELETE FROM AccountItem WHERE AID = '$busca2[0]'");
$delete2 = mssql_query("DELETE FROM CharacterItem WHERE AID = '$busca2[0]'");
$delete3 = mssql_query("DELETE FROM Character WHERE AID = '$busca2[0]'");
$delete4 = mssql_query("DELETE FROM Login WHERE AID = '$busca2[0]'");
$delete5 = mssql_query("DELETE FROM Account WHERE AID = '$busca2[0]';
}
echo "All banned accounts deleted successfully";
?>
Do not forget to edit your config.php file in startup time.
Last edited by gaspartx; 12-04-11 at 02:15 AM.
Where is the * in those querys?
Shouldn't it be
?PHP Code:DELETE * FROM AccountItem WHERE AID = '$busca2[0]'
Or can you do it without?
Added Tables to account named,PHP Code:<?php
//Coded by Dude3889
include "config.php";
function checkban(){
$query = mssql_query("SELECT * FROM Account WHERE AID = '"$_SESSION['AID']."'");
$getbanned = mssql_fetch_assoc($query);
if($getbanned['Ugrade']==253){
if($getbanned['perm']==1){
$delete = mssql_query("DELETE FROM AccountItem WHERE AID = '".$_SESSION['AID']."'");
$delete1 = mssql_query("DELETE FROM CharacterItem WHERE AID = '".$SESSION['AID']."'");
$delete2 = mssql_query("DELETE FROM Character WHERE AID = '".$_SESSION['AID']."'");
} else {
echo "Your Ban Ends On'".$getbanned['BanEnd']."'";
}
echo "Your Not even Banned";
}
}
?>
BanEnd(date)
Perm 1 = Banned forever 0 = Not
If the user is banned forever it will delete
date time will not automatically unban but that's easy to code.
I would put this in your login script so that when the user logins in the site it will ban delete it all, adding this to a account info page would be cool. this was coded in 5 minutes and may not work fully but easy to fix gl.