mjnaderi / Sharif-Judge

A free and open source online judge system for programming courses
https://github.com/mjnaderi/Sharif-Judge/tree/docs
GNU General Public License v3.0
388 stars 152 forks source link

Mysqli driver error #88

Open flitzcore opened 1 year ago

flitzcore commented 1 year ago

So I get this error:

A PHP Error was encountered
Severity: Error

Message: Uncaught mysqli_sql_exception: Table 'ojdatabase.shj_sessions' doesn't exist in /var/www/online-judge/system/database/drivers/mysqli/mysqli_driver.php:212 Stack trace: #0 /var/www/online-judge/system/database/drivers/mysqli/mysqli_driver.php(212): mysqli->query() #1 /var/www/online-judge/system/database/DB_driver.php(740): CI_DB_mysqli_driver->_execute() #2 /var/www/online-judge/system/database/DB_driver.php(605): CI_DB_driver->simple_query() #3 /var/www/online-judge/system/database/DB_query_builder.php(1589): CI_DB_driver->query() #4 /var/www/online-judge/system/libraries/Session/drivers/Session_cookie.php(525): CI_DB_query_builder->insert() #5 /var/www/online-judge/system/libraries/Session/drivers/Session_cookie.php(274): CI_Session_cookie->_sess_create() #6 /var/www/online-judge/system/libraries/Session/Session.php(665): CI_Session_cookie->initialize() #7 /var/www/online-judge/system/libraries/Driver.php(176): CI_Session_driver->decorate() #8 /var/www/online-judge/system/libraries/Session/Session.php(166): CI_Driver_Library->load_driver() #9 /var/www/online-judge/system/libraries/Session/Session.php(141): CI_Session->load_driver() #10 /var/www/online-judge/system/core/Loader.php(1172): CI_Session->__construct() #11 /var/www/online-judge/system/core/Loader.php(1044): CI_Loader->_ci_init_class() #12 /var/www/online-judge/system/core/Loader.php(200): CI_Loader->_ci_load_class() #13 /var/www/online-judge/system/core/Loader.php(691): CI_Loader->library() #14 /var/www/online-judge/system/core/Loader.php(1234): CI_Loader->driver() #15 /var/www/online-judge/system/core/Loader.php(146): CI_Loader->_ci_autoloader() #16 /var/www/online-judge/system/core/Controller.php(68): CI_Loader->initialize() #17 /var/www/online-judge/application/controllers/Dashboard.php(15): CI_Controller->__construct() #18 /var/www/online-judge/system/core/CodeIgniter.php(342): Dashboard->__construct() #19 /var/www/online-judge/index.php(287): require_once('...') #20 {main} thrown

Filename: mysqli/mysqli_driver.php

Line Number: 212

Backtrace:

But I already fill the database.php with appropriate setup of my database:

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
        'dsn'   => '',

        /*  Enter database connection settings here:  */
        'dbdriver' => 'mysqli',     // database driver (mysqli, postgre)
        'hostname' => 'localhost',  // database host
        'username' => 'dbuser',           // database username
        'password' => 'an1m3w1bu',           // database password
        'database' => 'ojdatabase',           // database name
        'dbprefix' => 'shj_',       // table prefix
        /**********************************************/

        'pconnect' => TRUE,
        'db_debug' => FALSE,
        'cache_on' => FALSE,
        'cachedir' => '',
        'char_set' => 'utf8',
        'dbcollat' => 'utf8_general_ci',
        'swap_pre' => '',
        'autoinit' => TRUE,
        'encrypt' => FALSE,
        'compress' => FALSE,
        'stricton' => FALSE,
        'failover' => array()
);

Anyone know this error? Or should i use postgre instead?

flitzcore commented 1 year ago

So it seems like it can't create session table? or i get it wrong?