DesrtHawk Posted March 31, 2006 Share Posted March 31, 2006 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 207Warning: 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.