simmsy Posted December 29, 2011 Share Posted December 29, 2011 Hi I wanted to know how once I have selected and echoed the rows from mysql table how can I get it to number those rows that echo? etc 1. echo $variable 2. echo $variable 3. echo $variable 4. echo $variable 5. echo $variable Any help is appreciated Quote Link to comment https://forums.phpfreaks.com/topic/254034-how-to-number-rows-that-have-been-selected/ Share on other sites More sharing options...
litebearer Posted December 29, 2011 Share Posted December 29, 2011 As in ORDERED LIST? (http://www.w3schools.com/css/css_list.asp) Quote Link to comment https://forums.phpfreaks.com/topic/254034-how-to-number-rows-that-have-been-selected/#findComment-1302284 Share on other sites More sharing options...
Pikachu2000 Posted December 29, 2011 Share Posted December 29, 2011 You can either use a numbered (ordred) list, or echo a variable that increments with each iteration of the loop. Quote Link to comment https://forums.phpfreaks.com/topic/254034-how-to-number-rows-that-have-been-selected/#findComment-1302286 Share on other sites More sharing options...
simmsy Posted December 29, 2011 Author Share Posted December 29, 2011 Yea I have the selected variables and ordered by $ DESC. But I want to list those echoed results from the table as 1, 2, 3 etc Quote Link to comment https://forums.phpfreaks.com/topic/254034-how-to-number-rows-that-have-been-selected/#findComment-1302302 Share on other sites More sharing options...
Pikachu2000 Posted December 29, 2011 Share Posted December 29, 2011 So then, what is the problem you're currently having? Did you look into using either method described above? Quote Link to comment https://forums.phpfreaks.com/topic/254034-how-to-number-rows-that-have-been-selected/#findComment-1302304 Share on other sites More sharing options...
simmsy Posted December 29, 2011 Author Share Posted December 29, 2011 how do i do the numbered(order) or increment? Quote Link to comment https://forums.phpfreaks.com/topic/254034-how-to-number-rows-that-have-been-selected/#findComment-1302314 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.