Location: PHPKode > projects > Akasha > empty_trash.php
<?
include ("includes/global.inc"); 	// Global Variables
include ("includes/functions.inc");	// Global Functions

if ($akashaID == $ID) {
	$user_id = findUserByHash($ID);
	$query = "select message_id from tblMessages where user_id = $user_id and mbox_id =$mbox_id";
	
	$result = mysql_db_query("$dbname",$query);
	while ($r = @mysql_fetch_array($result)) {
		$message_id = $r["message_id"];
		$query2 = "delete from tblAttachments where message_id = $message_id";
  		$result2 = mysql_db_query("$dbname",$query2);
	}

	$query = "delete from tblMessages where mbox_id=$mbox_id and user_id = $user_id";
	$result = mysql_db_query("$dbname",$query);

	Header("Location: mailbox.php?ID=$ID&mbox_id=$mbox_id&top=$top");
} else {
	Header("Location: main.php?error_code=1");
}

?>
Return current item: Akasha