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 Quote 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 (edited) 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, ... Edited August 4, 2014 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/290253-sql-results-counter/#findComment-1486776 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.