select card.* from card, ranking, sort where card.crid in (0,1000000131,1000000137,1000000132,1000000133,1000000135) and ranking.crid = card.crid and sort.crid = card.crid order by desc ranking.total

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'desc ranking.total' at line 1