我正在使用PHP和
mysql,我突然得到了
MysqL_data_seek() [function.MysqL-data-seek]: Offset 0 is invalid for MySQL result index 64 (or the query data is unbuffered)
这是什么意思.
我不知道从哪里开始调试这个.
class dbResult { private $result; private $num_rows; function __construct($result) { $this->result = $result; } function result($type = 'object') { @MysqL_data_seek($this->result,0); if ($type == 'array') return MysqL_fetch_assoc($this->result); if ($type == 'object') { if ($this->num_rows() == 1) { $data = new stdClass(); foreach (MysqL_fetch_assoc($this->result) as $k => $v) $data->$k = $v; return $data; } if ($this->num_rows() > 1) { $data = array(); while ($result = MysqL_fetch_assoc($this->result)) { $row = new stdClass(); foreach ($result as $k => $v) $row->$k = $v; $data[] = $row; } return $data; } return false; } } function num_rows() { return MysqL_num_rows($this->result); } function num_fields() { return MysqL_num_fields($this->result); } }