select card.crid from card, ranking where card.crid = ranking.crid and card.disp = 1 and card.company_ = order by ranking.total limit 0,20
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 'order by ranking.total limit 0,20' at line 1