MySQL server has gone away::SELECT * FROM radikalplayers.banners where ((activo='1' AND posicion='background' AND idiomas REGEXP '[[:<:]]ES[[:>:]]') AND ((CURDATE()>=fechaInicio AND CURDATE()<=fechaFin) OR (fechaInicio IS NULL AND fechaFin IS NULL) OR (curDate()>=fechaInicio AND fechaFin IS NULL) OR (fechaInicio IS NULL AND curDate()<=fechaFin))) ORDER BY orden