demeritrious Posted August 3, 2014 Share Posted August 3, 2014 I know this should be easy but I cannot find right query to do this online. I simple want a counter of each result of my query. What is the proper way to query this. For example 1 | Result 1 2 | Result 2 3 | Result 3 The one I found online did a weird grouping counter. Thanks Link to comment https://forums.phpfreaks.com/topic/290253-sql-results-counter/ Share on other sites More sharing options...
requinix Posted August 4, 2014 Share Posted August 4, 2014 Do it in your code instead. [edit] Well, this is in MySQL after all... You use a variable, then select and increment in the same operation. Like SELECT @var := @var + 1, ... Link to comment https://forums.phpfreaks.com/topic/290253-sql-results-counter/#findComment-1486776 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.