|
1 | 1 | <?php |
2 | 2 | error_reporting(E_ALL); |
3 | | -if(version_compare(PHP_VERSION,'5.4.0','<')) die('Require PHP 5.4 or higher'); |
4 | 3 | if(!extension_loaded('mysqli') && !extension_loaded('pdo_mysql')) die('Install mysqli or pdo_mysql extension!'); |
5 | 4 | session_name('SQL'); |
6 | 5 | session_start(); |
7 | 6 | $bg=2; |
8 | 7 | $step=20; |
9 | | -$version="3.19"; |
| 8 | +$version="3.20"; |
10 | 9 | $bbs=['False','True']; |
11 | 10 | $deny=['mysql','information_schema','performance_schema','sys']; |
12 | 11 | $js=(file_exists('jquery.js')?"/jquery.js":"https://code.jquery.com/jquery-1.12.4.min.js"); |
@@ -56,8 +55,7 @@ public function query($sql) { |
56 | 55 | public function begin() { |
57 | 56 | if($this->dbty==self::$sqltype[0]) { |
58 | 57 | $this->_cnx->autocommit(FALSE); |
59 | | - if(version_compare(PHP_VERSION,'5.5.0','<')) return $this->query("START TRANSACTION"); |
60 | | - else return $this->_cnx->begin_transaction(); |
| 58 | + return $this->_cnx->begin_transaction(); |
61 | 59 | } else { |
62 | 60 | return $this->_cnx->beginTransaction(); |
63 | 61 | } |
@@ -605,7 +603,7 @@ public function create_ro($db,$pn) { |
605 | 603 | $head='<!DOCTYPE html><html lang="en"><head> |
606 | 604 | <title>EdMyAdmin</title><meta charset="utf-8"> |
607 | 605 | <style> |
608 | | -*{margin:0;padding:0;font-size:12px;color:#333;font-family:Arial} |
| 606 | +*{margin:0;padding:0;font-size:14px;color:#333;font-family:Arial} |
609 | 607 | html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;background:#fff} |
610 | 608 | html,textarea{overflow:auto} |
611 | 609 | .container{overflow:auto;overflow-y:hidden;-ms-overflow-y:hidden;white-space:nowrap;scrollbar-width:thin} |
@@ -1014,7 +1012,7 @@ public function create_ro($db,$pn) { |
1014 | 1012 | $q_co=$ed->con->query("SHOW FULL FIELDS FROM `$tb`")->fetch(1); |
1015 | 1013 | foreach($q_co as $k=>$r_co) { |
1016 | 1014 | if($ed->post('n1')==$r_co[0] && $r_co[4]!='PRI' && empty($r_co[6])) { |
1017 | | - $ed->con->query("ALTER TABLE `$tb` MODIFY COLUMN ".$r_co[0]." ".$r_co[1]." ".(($ed->post('n2')=="x" && $q_co[0][4]!='PRI' && empty($q_co[0][6]))?"FIRST":"AFTER ".$ed->post('n2'))); |
| 1015 | + $ed->con->query("ALTER TABLE `$tb` MODIFY COLUMN ".$r_co[0]." ".$r_co[1]." ".($r_co[3]=='NO'?'NOT NULL':'NULL')." ".(($ed->post('n2')=="x" && $q_co[0][4]!='PRI' && empty($q_co[0][6]))?"FIRST":"AFTER ".$ed->post('n2'))); |
1018 | 1016 | } |
1019 | 1017 | } |
1020 | 1018 | exit; |
|
0 commit comments