I have an array coming from a mysql statement. It is being convered into an array using mysql_fetch_array. This is then fed into a while loop. I want the array to be reversed.
Currently it is printing the results as
Bob, 23
Steve, 26

However I want it to echo Steve before Bob. How could I do this?

Why not use the array_reverse() function upon the array first, and then iterate through the reversed array elements afterwards with your while loop?

Either the above, or change your query to return the items in the order you want.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.