Any Suggestions On What I Should Do? :blush:Quote:
Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index 32 (or the query data is unbuffered) in admin/db_mysql.php on line 187
Printable View
Any Suggestions On What I Should Do? :blush:Quote:
Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index 32 (or the query data is unbuffered) in admin/db_mysql.php on line 187
maybe you should try posting line 187 and the lines around it
I'm Not Too Familiar w/ It All.
But Here's The Actual File Itself.
<~ Dazed & Confused :confused:
I'm guessing this is what you're having problems with, and it would've been easier to just have given me it instead of the whole script.
Well, I think PHP is telling you that there is no position below 0? I'm not sure, but maybe you should default $query_id to '0' or '1' instead of '-1', and I'm guessing '1' would be better because MySQL gives you the error of 0 being invalid.. never used mysql_data_seek() before, so you might try changing it altogether to something like:PHP Code:function data_seek($pos,$query_id=-1) {
// goes to row $pos
if ($query_id!=-1) {
$this->query_id=$query_id;
}
return mysql_data_seek($this->query_id, $pos);
}
edit: If $query_id is below 1, well, won't $this->query_id be undefined? Maybe you should just change it to "if($query_id > 0)", or get rid of the if statement altogether or something..PHP Code:function data_seek($pos, $query_id=1) { //changed "=-1" to "=1"
// goes to row $pos
if ($query_id > 1) { //changed "!=-1" to "> 1"
$this->query_id=$query_id;
}
return mysql_data_seek($this->query_id, $pos);
}
Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index 31 (or the query data is unbuffered) in admin/db_mysql.php on line 187
Anyway I Can Log-In To PHPMyAdmin And Fix This?
Like Buffer It Or Something... I'm So Lost It's Sad...
~1~
P.S. I Really Appreciate The Help!! :)
The second parameter of mysql_data_seek() says which row number you would like to go to. There are no rows below 0. So -1 is invalid. You need to default to 0.
The second argument is valid for 0 to mysql_num_rows() - 1.
So as kows has already stated, you must change the number you are defaulting to.
Scratch that. Your code is screwing up the FIRST parameter of mysql_data_seek(). The first parameter should be a resource identifier, NOT an integer.
Where did you get this code from?
"It is perfectly possible for a query to succeed but affect no rows or return no rows." So make sure that there are rows before you try to seek to a specific row. I would suggest testing if your num_rows or mysql_num_rows is > 0 in your function query at line 97 before passing around a bad $this->query_id.
Your other functions sometimes default to using the already set $this->query_id, so that had better be valid. You might also want to reconsider if you need to be passing around a query_id in the first place. Each object looks like it would keep its own query_id based on the query_string passed to function query (unless you are asking object A to give the results of the query performed by object B).Code:if (!$this->query_id) {
$this->halt("Invalid SQL: ".$query_string);
}
//this line
$query_count++;.