File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 41
41
42
42
include (EASYWIDIR . '/stuff/keyphrasefile.php ' );
43
43
44
+ if (!isset ($ tables )) {
45
+
46
+ require_once (EASYWIDIR . '/stuff/methods/class_tables.php ' );
47
+
48
+ if (!isset ($ dbConnect ['db ' ])) {
49
+
50
+ include (EASYWIDIR . '/stuff/config.php ' );
51
+
52
+ $ dbConnect ['db ' ] = $ db ;
53
+ }
54
+
55
+ $ tables = new Tables ($ dbConnect ['db ' ]);
56
+ }
57
+
44
58
// Execute correct, so we can update game templates
45
59
$ tables ->correctExistingTables ();
46
60
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ function __construct($dbName) {
55
55
$ this ->dbName = $ dbName ;
56
56
$ this ->sql = $ sql ;
57
57
58
+ $ this ->sql ->setAttribute (PDO ::ATTR_ERRMODE , PDO ::ERRMODE_EXCEPTION );
59
+
58
60
$ this ->getTableDefinitions ();
59
61
$ this ->getTablesColumnConfigurations ();
60
62
}
@@ -124,8 +126,10 @@ private function executeChange($sqlStatement) {
124
126
$ this ->executedSql [] = $ sqlStatement ;
125
127
126
128
try {
129
+
127
130
$ query = $ this ->sql ->prepare ($ sqlStatement );
128
131
$ query ->execute ();
132
+
129
133
} catch (PDOException $ error ) {
130
134
$ this ->errors [] = 'Error Message: ' . $ error ->getMessage () . ' Executed SQL was: ' . $ sqlStatement ;
131
135
}
You can’t perform that action at this time.
0 commit comments