title: Offset 0 is invalid for MySQL result index 64 (or the query data is unbuffered)
body: <p>I am working with php and mysql and suddenly I get</p>
  
  <blockquote>
    <p>mysql_data_seek() [function.mysql-data-seek]: Offset 0 is invalid for MySQL result index 64 (or the query data is unbuffered)</p>
  </blockquote>
  
  <p>What does this mean.</p>
  
  <p>I have no idea where to start to debug this one.</p>
  
  <p><hr />
  <strong>This class is passed a mysql resource into it's constructor</strong><br /></p>
  
  <pre><code>class dbResult {
  
      private $result;
      private $num_rows;
  
      function __construct($result) {
          $this-&gt;result = $result;
      }
  
      function result($type = 'object') {
          @mysql_data_seek($this-&gt;result, 0);
          if ($type == 'array')
              return mysql_fetch_assoc($this-&gt;result);
          if ($type == 'object') {
              if ($this-&gt;num_rows() == 1) {
                  $data = new stdClass();
                  foreach (mysql_fetch_assoc($this-&gt;result) as $k =&gt; $v)
                      $data-&gt;$k = $v;
                  return $data;
              }
              if ($this-&gt;num_rows() &gt; 1) {
                  $data = array();
                  while ($result = mysql_fetch_assoc($this-&gt;result)) {
                      $row = new stdClass();
                      foreach ($result as $k =&gt; $v)
                          $row-&gt;$k = $v;
                      $data[] = $row;
                  }
                  return $data;
              }
              return false;
          }
      }
  
      function num_rows() {
          return mysql_num_rows($this-&gt;result);
      }
  
      function num_fields() {
          return mysql_num_fields($this-&gt;result);
      }
  
  }
  </code></pre>