表ci_session不存在错误

时间:2018-07-21 12:36:21

标签: php codeigniter session ion-auth

我试图通过this链接在我的codeigniter中配置ion_auth。正如tutorialcodeigniter教程中所示的第一步,我在config.php中设置了seeion下方:

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_session';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

autoload.php

$autoload['libraries'] = array('session','database');

创建的ci_session表:

CREATE TABLE IF NOT EXISTS `ci_sessions` (
    `id` varchar(128) NOT NULL,
    `ip_address` varchar(45) NOT NULL,
    `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
    `data` blob NOT NULL,
    KEY `ci_sessions_timestamp` (`timestamp`)
 );

但是当我加载我的codeigniter时,出现此错误:

        A Database Error Occurred
    Error Number: 1146

    Table 'db_platform.ci_session' doesn't exist

    SELECT `data` FROM `ci_session` WHERE `id` = '957v38u8kf237dnsbq5f63345opank6t'

    Filename: D:/xampp/htdocs/platform/system/database/DB_driver.php

    Line Number: 691

我不知道我要去哪里。我是Codeigniter会话和ion_auth的新手。谁能帮我吗?

1 个答案:

答案 0 :(得分:3)

您的表名中有一个错字,因为在创建表语法中,它是ci_sessions

CREATE TABLE IF NOT EXISTS `ci_sessions` (

在错误中,表名称ci_session中显示错误

SELECT `data` FROM `ci_session` WHERE `id` = '957v38u8kf237dnsbq5f63345opank6t'.

因此,您在表名中缺少s