Jump to content

DesrtHawk

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DesrtHawk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, I'm trying to make login script that will check username and password from user form to data in the database. I'm using one of my classes to work with the mysql database and today for first time I met strange error that I have never seen: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Warning: mysql_data_seek() [function.mysql-data-seek]: Offset 0 is invalid for MySQL result index 7 (or the query data is unbuffered) in ***\dbclass.php on line 207 Warning: mysql_data_seek() [function.mysql-data-seek]: Offset 0 is invalid for MySQL result index 7 (or the query data is unbuffered) in ***\dbclass.php on line 220[/quote] Both lines contain data_seek function: [code]mysql_data_seek($result, 0);[/code] And here is the code: [code]             $result = mysql_query ($query) or                                 die ("<b>Query failed (function do_query: $query)</b><br />");             if ( preg_match("/^SELECT/i", $query) ) {                             $rows = mysql_num_rows($result);                             $this->numfields = mysql_num_fields ($result);                                 mysql_data_seek($result, 0);                                 $i = 0;                                 while ($i < $this->numfields) {                                         $currField = mysql_fetch_field($result, $i);                                         $this->fields[$i] = $currField->name;                                         $i++;                                 }                                 mysql_data_seek($result, 0);             } [/code] The query still works, but I want to know why I get this warning and how to fix it. Thanks in advance! [b]EDIT[/b] Nevermind, I found the problem, I had wrond query syntax, strange I haven't seen it before :P
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.