Get Current Row Number (Cursor Location)

mardi 7 avril 2015

mysqli_data_seek works to get to a specific record. The problem that I am having is finding a method that returns the current cursor location.



I am developing PHP code to allow scrolling to either the next record or to the prior record. One way to accomplish this would be to have a query which keys the row number to the primary key (IssueIDNUM).



Would that be the way to go, or are there other alternative approaches?




Code:



$query = "Select (@row_number:=@row_number + 1) AS rownumber, IssueIDNUM FROM tblIssueList, (SELECT @row_number:=0 ) AS tblTemp ORDER by IssueDate DESC, IssueIDNUM";



Get Current Row Number (Cursor Location)

0 commentaires:

Enregistrer un commentaire

Labels