Changeset 307 for minimanager/scripts/del_lib.php
- Timestamp:
- Mar 13, 2008, 8:18:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/scripts/del_lib.php
r178 r307 18 18 $sql_01 = new SQL; 19 19 $sql_01->connect($characters_db[$realm]['addr'], $characters_db[$realm]['user'], $characters_db[$realm]['pass'], $characters_db[$realm]['name']); 20 $query = $sql_01->query("SELECT account,online FROM `character ` WHERE guid ='$guid' LIMIT 1");20 $query = $sql_01->query("SELECT account,online FROM `characters` WHERE guid ='$guid' LIMIT 1"); 21 21 $owner_acc_id = $sql_01->result($query, 0, 'account'); 22 22 $sql_01->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); … … 64 64 foreach ($characters_db as $db){ 65 65 $sql_01->connect($db['addr'], $db['user'], $db['pass'], $db['name']); 66 $result = $sql_01->query("SELECT guid FROM `character ` WHERE account='$acc_id'");66 $result = $sql_01->query("SELECT guid FROM `characters` WHERE account='$acc_id'"); 67 67 while ($row = $sql_01->fetch_array($result)) { 68 68 foreach ($tab_del_user_characters as $value) … … 100 100 $query = $sql_01->query("DELETE FROM guild_rank WHERE guildid = '$guid'"); 101 101 102 //clean data inside character .data field102 //clean data inside characters.data field 103 103 $temp = $sql_01->query("SELECT guid FROM guild_member WHERE guildid = '$guid'"); 104 104 while ($guild_member = $sql_01->fetch_row($temp)){ 105 $char_data = $sql_01->query("SELECT data FROM `character ` WHERE guid = '$guild_member[0]'");105 $char_data = $sql_01->query("SELECT data FROM `characters` WHERE guid = '$guild_member[0]'"); 106 106 $data = $sql_01->result($char_data, 0, 'data'); 107 107 $data = explode(' ',$data); … … 109 109 $data[CHAR_DATA_OFFSET_GUILD_RANK] = 0; 110 110 $data = implode(" ",$data); 111 $query = $sql_01->query("UPDATE `character ` SET data = '$data' WHERE guid = '$guild_member[0]'");111 $query = $sql_01->query("UPDATE `characters` SET data = '$data' WHERE guid = '$guild_member[0]'"); 112 112 } 113 113 … … 123 123 } 124 124 125 //########################################################################################## 126 //Delete Arena Team 127 function del_arenateam($guid,$realm){ 128 global $characters_db, $realm_db; 129 130 require_once("scripts/defines.php"); 131 132 $sql_01 = new SQL; 133 $sql_01->connect($characters_db[$realm]['addr'], $characters_db[$realm]['user'], $characters_db[$realm]['pass'], $characters_db[$realm]['name']); 134 $query = $sql_01->query("DELETE FROM arena_team WHERE arenateamid = '$guid'"); 135 $query = $sql_01->query("DELETE FROM arena_team_stats WHERE arenateamid = '$guid'"); 136 137 // Cant clean the character data field since the data is incorrect on these fields 138 // http://wiki.udbforums.org/index.php/Character_data 139 //clean data inside characters.data field 140 //$temp = $sql_01->query("SELECT guid FROM arena_team_member WHERE arenateamid = '$guid'"); 141 //while ($arenateam_member = $sql_01->fetch_row($temp)){ 142 // $char_data = $sql_01->query("SELECT data FROM `characters` WHERE guid = '$arenateam_member[0]'"); 143 // $data = $sql_01->result($char_data, 0, 'data'); 144 // $data = explode(' ',$data); 145 // $data[CHAR_DATA_OFFSET_GUILD_ID] = 0; 146 // $data[CHAR_DATA_OFFSET_GUILD_RANK] = 0; 147 // $data = implode(" ",$data); 148 // $query = $sql_01->query("UPDATE `characters` SET data = '$data' WHERE guid = '$arenateam_member[0]'"); 149 // } 150 // 151 $query = $sql_01->query("DELETE FROM arena_team_member WHERE arenateamid = '$guid'"); 152 153 if ($sql_01->affected_rows()){ 154 $sql_01->close(); 155 return true; 156 } else { 157 $sql_01->close(); 158 return false; 159 } 160 } 161 125 162 ?>
Note:
See TracChangeset
for help on using the changeset viewer.