【发布时间】:2015-06-28 03:14:22
【问题描述】:
我正在尝试做一个 OTH 应用程序,但我收到了这个错误
发生数据库错误
错误号:1054
“字段列表”中的未知列“数据”
选择
dataFROMci_sessionsWHEREid= 'dd8fddaabb45c365fbf27a6fdc5ea60d59f569e4' 和ip_address= '::1'文件名:libraries/Session/drivers/Session_database_driver.php
行号:160
这是 Session_database_driver.php
public function read($session_id) {
if ($this->_get_lock($session_id) !== FALSE)
{
// Needed by write() to detect session_regenerate_id() calls
$this->_session_id = $session_id;
$this->_db
->select('data')
->from($this->_config['save_path'])
->where('id', $session_id);
if ($this->_config['match_ip'])
{
$this->_db->where('ip_address', $_SERVER['REMOTE_ADDR']);
}
if (($result = $this->_db->get()->row()) === NULL)
{
$this->_fingerprint = md5('');
return '';
}
// PostgreSQL's variant of a BLOB datatype is Bytea, which is a
// PITA to work with, so we use base64-encoded data in a TEXT
// field instead.
$result = ($this->_platform === 'postgre')
? base64_decode(rtrim($result->data))
: $result->data;
$this->_fingerprint = md5($result);
$this->_row_exists = TRUE;
return $result;
}
$this->_fingerprint = md5('');
return '';
}
【问题讨论】:
-
@OfirBaruch 我试过了,但它不起作用。实际上那里有一些表名丢失的问题。
-
如果您将
select('data')更改为select('user_data')会发生什么? -
@OfirBaruch 'where 子句'中的未知列'id' SELECT
user_dataFROMci_sessionsWHEREid= '0c37a2a2094055181b386efea510a21068d71e4d' AND @98765span>@98765span>2':1':1' -
我想我理解这个问题
标签: php codeigniter wamp