dougaicha5258 2015-09-17 00:28
浏览 57

SQL错误 - CodeIgniter登录错误

I'm trying to create a login function while learning CodeIgniter. I've validated that both the username and password are correct. The passwords are encrypted using Phppass codeigniter password library.

This is the error I get after I login with the correct information.

A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

'(`session_id`, `ip_address`, `user_agent`, `last_activity`)
 VALUES ('826f937fed9' at line 1

 INSERT INTO (`session_id`, `ip_address`, `user_agent`,
 `last_activity`) VALUES ('826f937fed9185e2c121ec06b1b44b6a', '::1',
 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/53', 1442454002)

Filename: libraries/Session.php

Line Number: 327

  • 写回答

2条回答 默认 最新

  • douliwang6896 2015-09-17 02:12
    关注

    As Jarred Farrish and Darack on the PHP chatrooms pointed out the error was right in front of me! I had forgotten to add my CodeIgniter database tbl name to the config! Well, not exactly. I thought I followed the instructions from the CodeIgniter config correctly but apparently not! As the documentation differs slightly, you must in fact ADD

    $config['sess_table_name'] = 'ci_sessions';
    

    To your config.php file. Once that has been added CodeIgniter will correctly store user data in that table name provided.

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置