Vruca-Delun
New Member
I have a set of records in a mysql database and am trying to make select next and previous buttons on a webpage. I have issues coding it in php however; any help is greatly appreciated.My records do not have auto increment id attached to them.My code is as follows:\[code\]$result = mysql_query($query) or die("Couldn't execute query");$row_number = 1;while ($row = mysql_fetch_assoc($result)) { $row_number ++;if ($row_number <= mysql_num_rows($result)) {$nextRecord=mysql_data_seek($result,$row_number); while ($nextRow = mysql_fetch_row($nextRecord)) { echo $nextRow['family_accession_number'];}\[/code\]when I try to run the script, the following message came out:\[code\]Warning: mysql_data_seek() [function.mysql-data-seek]: Offset 2 is invalid for MySQL result index 3 (or the query data is unbuffered) in C:\xampp\htdocs\survey\continuetitle.php on line 23Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\survey\continuetitle.php on line 25\[/code\]Line 23 is: \[code\]$nextRecord=mysql_data_seek($result,$row_number);\[/code\]Thanks!EDIT:I changed \[code\]while ($nextRow = mysql_fetch_row($nextRecord)) {\[/code\] to \[code\]while ($nextRow = mysql_fetch_row($result)) { \[/code\]but the same error occurs on line 23EDIT:Found error in SQL query which returns only one row.