Changeset 19 for minimanager/run_patch.php
- Timestamp:
- Aug 13, 2007, 9:05:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/run_patch.php
r5 r19 67 67 if ( empty($_POST['query']) || empty($_POST['use_db']) ) redirect("run_patch.php?error=1"); 68 68 69 $ mysql = new MySQL;70 $ mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);69 $sql = new SQL; 70 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 71 71 72 $use_db = $ mysql->quote_smart($_POST['use_db']);72 $use_db = $sql->quote_smart($_POST['use_db']); 73 73 $query = $_POST['query']; 74 74 75 if ($use_db == $realm_db['name']) $ mysql->db($realm_db['name']);75 if ($use_db == $realm_db['name']) $sql->db($realm_db['name']); 76 76 else { 77 77 foreach ($mangos_db as $db) 78 if ($use_db == $db['name']) $ mysql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);78 if ($use_db == $db['name']) $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']); 79 79 } 80 80 … … 95 95 foreach($qr as $qry) { 96 96 $line++; 97 if(trim($qry)) ($ mysql->query(trim($qry))?$good++:$bad++);97 if(trim($qry)) ($sql->query(trim($qry))?$good++:$bad++); 98 98 if ($bad) { 99 $err = ereg_replace ("\n","", mysql_error());99 $err = ereg_replace ("\n","",$sql->error()); 100 100 $err = ereg_replace ("\r\n$","",$err); 101 101 $err = ereg_replace ("\r$","",$err); … … 105 105 } 106 106 107 $ mysql->close();107 $sql->close(); 108 108 109 109 if ($queries) redirect("run_patch.php?error=2&tot=$good");
Note:
See TracChangeset
for help on using the changeset viewer.