## PHP, SQL code not working as expected

Question

I have a search and pagination script which runs fine if I use the query:

Select * from results



However when I try to use the query:

SELECT    id,
name,
team,
points,
@curRank := @curRank + 1 AS position
FROM      results,  (SELECT @curRank := 0) r
ORDER BY  points  DESC


This pulls all the correct data through and creates the extra column position, but stops the pagination working so all the records are shown and the search function does not work.

What would I need to change to get it to work? Any ideas would be appreciated

0
8 months 2020-11-26T06:10:55-05:00 0 Answers 11 views 0