当我检索大量数据时,我收到错误“500 Internal Server Error”。当我选择一个只有10个城市的国家时,它会起作用,但是当我选择一个拥有10万个城市的国家时,就会出现错误。对此有何解决方案?
我的剧本
public function getCountry()
{
$countries = Country::all();
$cat_id = Input::get('cat_id');
$cities = City::where('id', '=', $cat_id)->get();
return View::make('countrycity.countrycity')
->with('countries',$countries)
->with('cities',$cities)
->with('title', 'Ajax');
}
public function getCity()
{
$cat_id = Input::get('cat_id');
$cities = City::where('CC_FIPS', '=', $cat_id)->get();
return Response::json($cities);
}
我的控制器
public function get_total_pages() {
return $this->db->count_all($this->db->dbprefix . 'page');
}