I ran this query on a table with around 211,000 rows. The table is basically a mapping of X's to Y's.
SELECT xid, count(yid) AS tot FROM x_y_map WHERE z=11 GROUP BY xid ORDER BY tot DESC
Without the ORDER BY the query runs fine and returns each X with their Y count, but at the top it says "Showing rows 0 - 0 ( 1 total, Query took 0.0003 sec)".
With the ORDER BY phpmyadmin just returns one row: 0 / 36503.
Removing the z=11 bit also returns the correct results. (Incidentally, z=11 account for 36k of the 211k rows.)
If I run the query through PHP's mysql_query I get the correct results, so the query is correct and PHP/MySQL are working fine. PHPMyAdmin is either running a different query or messing up the results display.
Server: Localhost via UNIX socket
Server version: 5.1.41-3ubuntu12.10