SELECT * FROM `pays` WHERE `type`=10 AND `category`=0;
SELECT * FROM `pays` WHERE `type`=10 AND `category`=0 AND mid<=0;
SELECT SQL_CALC_FOUND_ROWS p.*,u.name,u.grp FROM pays p LEFT JOIN users u ON u.id=p.mid WHERE p.type=10 AND p.mid<=0 ORDER BY p.time