I work with php and mysql and suddenly get
mysql_data_seek () [function.mysql-data-seek]: offset 0 is not valid for the MySQL 64 result index (or query data is not loaded)
What does it mean.
I donβt know where to start debugging this one.
This class is passed by the mysql resource to the constructor.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); } }
php mysql
Hailwood
source share