$sql = "SELECT `Dish`.*, `Location`.*, `User`.*, `Restaurant`.`name` FROM `dishes` AS `Dish` LEFT JOIN `restaurant_locations` AS `Location` ON (`Dish`.`location_id` = `Location`.`id`) LEFT JOIN `users` AS `User` ON (`Dish`.`user_id` = `User`.`id`) LEFT JOIN `restaurants` AS `Restaurant` ON (`Location`.`restaurant_id` = `Restaurant`.`id`) WHERE `Dish`.`disabled`=0 ORDER BY `distance_from_user` ASC LIMIT 5"
$error = "1054: Unknown column 'distance_from_user' in 'order clause'"
$out = null
DboSource::showQuery() - CORE/cake/libs/model/datasources/dbo_source.php, line 514
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 201
DboSource::fetchAll() - CORE/cake/libs/model/datasources/dbo_source.php, line 337
DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php, line 636
Model::find() - CORE/cake/libs/model/model.php, line 1956
Model::findAll() - CORE/cake/libs/model/model.php, line 2821
Dish::getAllDishes() - APP/models/dish.php, line 507
Dish::executeFind() - APP/models/dish.php, line 759
DishesController::index() - APP/controllers/dishes_controller.php, line 208
Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
[main] - APP/webroot/index.php, line 84
Query: SELECT `Dish`.*, `Location`.*, `User`.*, `Restaurant`.`name` FROM `dishes` AS `Dish` LEFT JOIN `restaurant_locations` AS `Location` ON (`Dish`.`location_id` = `Location`.`id`) LEFT JOIN `users` AS `User` ON (`Dish`.`user_id` = `User`.`id`) LEFT JOIN `restaurants` AS `Restaurant` ON (`Location`.`restaurant_id` = `Restaurant`.`id`) WHERE `Dish`.`disabled`=0 ORDER BY `distance_from_user` ASC LIMIT 5
Warning (2): Invalid argument supplied for foreach() [APP/models/dish.php, line 584]
// tack on the Restaurant and the avg Vote to the Location $i = 0; foreach ($all_dishes as $dish) {
Dish::decorateDishes() - APP/models/dish.php, line 584
Dish::executeFind() - APP/models/dish.php, line 763
DishesController::index() - APP/controllers/dishes_controller.php, line 208
Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
[main] - APP/webroot/index.php, line 84
SELECT `Dish`.*, `Location`.*, `User`.*, `Restaurant`.`name` FROM `dishes` AS `Dish` LEFT JOIN `restaurant_locations` AS `Location` ON (`Dish`.`location_id` = `Location`.`id`) LEFT JOIN `users` AS `User` ON (`Dish`.`user_id` = `User`.`id`) LEFT JOIN `restaurants` AS `Restaurant` ON (`Location`.`restaurant_id` = `Restaurant`.`id`) WHERE `Dish`.`disabled`=0 ORDER BY `distance_from_user` ASC LIMIT 5
1054: Unknown column 'distance_from_user' in 'order clause'
0
3
SELECT COUNT(*) AS `count` FROM `dishes` AS `Dish` LEFT JOIN `restaurant_locations` AS `Location` ON (`Dish`.`location_id` = `Location`.`id`) LEFT JOIN `users` AS `User` ON (`Dish`.`user_id` = `User`.`id`) LEFT JOIN `restaurants` AS `Restaurant` ON (`Location`.`restaurant_id` = `Restaurant`.`id`) WHERE `Dish`.`disabled`=0
1
1
0
4
SELECT `DishSet`.*, `DishSet`.`id` FROM `sets` AS `DishSet` LEFT JOIN `users` AS `User` ON (`DishSet`.`user_id` = `User`.`id`) WHERE `DishSet`.`name` <> "Must Try" AND `DishSet`.`count_dishes` > 0 ORDER BY `DishSet`.`modified` DESC LIMIT 5