SELECT DISTINCT(i.id), i.*
  FROM phpwebgallery_images AS i
    INNER JOIN phpwebgallery_image_category AS ic ON i.id = ic.image_id
  WHERE ((name LIKE '%Rempała%' OR keywords LIKE '%Rempała%' OR author LIKE '%Rempała%'))
   ORDER BY date_available DESC, file ASC, id ASC
   LIMIT 9,3;
[mysql error 1030] Got error 28 from storage engine