Example #1
0
             $cfg->emessage = 'Could not get version from SQL server.';
         }
         if ($goodVersion === false) {
             $cfg->error = true;
             $cfg->emessage = 'You are using an unsupported version of ' . $cfg->DB_SYSTEM . ' the minimum allowed version is ' . nZEDb_MINIMUM_MYSQL_VERSION;
         }
     }
 }
 // Start inserting data into the DB.
 if (!$cfg->error) {
     $cfg->setSession();
     $DbSetup = new \nzedb\db\DbUpdate(['backup' => false, 'db' => $pdo]);
     try {
         $DbSetup->processSQLFile();
         // Setup default schema
         $DbSetup->loadTables();
         // Load default data files
         $DbSetup->processSQLFile(['filepath' => nZEDb_RES . 'db' . DS . 'schema' . DS . 'mysql-data.sql']);
     } catch (\PDOException $err) {
         $cfg->error = true;
         $cfg->emessage = "Error inserting: (" . $err->getMessage() . ")";
     }
     if (!$cfg->error) {
         // Check one of the standard tables was created and has data.
         $dbInstallWorked = false;
         $reschk = $pdo->query("SELECT COUNT(*) AS num FROM tmux");
         if ($reschk === false) {
             $cfg->dbCreateCheck = false;
             $cfg->error = true;
             $cfg->emessage = 'Could not select data from your database, check that tables and data are properly created/inserted.';
         } else {