diff --git a/web/application/controllers/main.php b/web/application/controllers/main.php index b9744a9..49bf7ad 100644 --- a/web/application/controllers/main.php +++ b/web/application/controllers/main.php @@ -4,7 +4,9 @@ class main extends base { public function index() { - $jobs = \application\models\Jobs::getByField("user_id", $this->user->id); - echo $this->loadRender("main.html", ["jobs" => $jobs]); + if ($this->user) { + $jobs = \application\models\Jobs::getByField("user_id", $this->user->id); + echo $this->loadRender("main.html", ["jobs" => $jobs]); + } } } \ No newline at end of file diff --git a/web/system/vendor/DB.php b/web/system/vendor/DB.php index c05a33f..dfb343a 100644 --- a/web/system/vendor/DB.php +++ b/web/system/vendor/DB.php @@ -157,6 +157,9 @@ class DB case "SQLITE": return self::fetch("PRAGMA table_info($table)", null, 1); break; + case "MySQL": + return self::fetch("DESC $table", null, 0); + break; } } } \ No newline at end of file