Skip to content

Commit 56dde74

Browse files
authored
1.4
-add error message to drop collection
1 parent a3bdc3f commit 56dde74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mongo.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
session_start();
66
$bg=2;
77
$step=20;
8-
$version="1.3";
8+
$version="1.4";
99
class DBT {
1010
private static $instance=NULL;
1111
protected $_cnx,$db,$bw,$wc;
@@ -683,8 +683,12 @@ public function imp_xml($body) {
683683
$db=$ed->sg[1];
684684
$tb=$ed->sg[2];
685685
$tbs=$ed->listCollection($db);
686+
try {
686687
$ed->con->commands($db,["drop"=>$tb]);
687688
$ed->redir((count($tbs)<2?"":"5/$db"),['ok'=>"Successfully dropped"]);
689+
} catch(Exception $e) {
690+
$ed->redir("5/$db",['err'=>"Drop failed"]);
691+
}
688692
break;
689693

690694
case "30"://import

0 commit comments

Comments
 (0)