MySQL server has gone away : SELECT EstDetails.*, Details.*, CountyDetails.CountyName, CountyDetails.CountyNameCut, CountyDetails.CountryID, hocounty, bcomregion, EstablishmentType.type AS ET, menus.web AS mweb, AS mmenu, Country.Name AS country, specialoffers.heading, specialoffers.content, DATE_FORMAT(specialoffers.entered, '%a %D %b %Y') AS day,, Towns.ID AS tid, Towns.latitude AS tlat, Towns.longitude AS tlong, FROM EstDetails INNER JOIN CountyDetails ON EstDetails.County = CountyDetails.RecordID INNER JOIN EstablishmentType ON EstablishmentType.ID = EstDetails.EstType INNER JOIN Details ON EstDetails.RecordID = Details.RecordID LEFT JOIN menus ON EstDetails.RecordID = menus.est LEFT JOIN Country ON CountyDetails.CountryID = Country.ID LEFT JOIN specialoffers ON specialoffers.placeid = EstDetails.RecordID LEFT JOIN Towns ON Towns.Name = EstDetails.Town AND Towns.County = EstDetails.County LEFT JOIN christmasoffers ON = EstDetails.RecordID and offeryear = 2020 WHERE EstDetails.RecordID = 104558