SELECT COUNT(DISTINCT(id)) AS nb_total_images
  FROM phpwebgallery_images
    INNER JOIN phpwebgallery_image_category AS ic ON id = ic.image_id
  WHERE (date_creation = '2005-07-02')
;
[mysql error 2013] Lost connection to MySQL server during query