SELECT DISTINCT(id),path,file,date_available
       ,tn_ext,name,filesize,storage_category_id,average_rate
  FROM magalerieimages AS i
    INNER JOIN magalerieimage_category AS ic ON id=ic.image_id
  WHERE hit > 0
   ORDER BY hit DESC, file ASC
  LIMIT 45,-30
;
[mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-30' at line 7