MySQL server has gone away

Call to a member function getListingCountByParam() on null