I am trying to create my own MySQL queries in Cakephp.
This is my LocationsController.php
:
Location Controller should be:
loadModel("Location");
$this->LocationModel->getLocations(); // I will strongly discourage using get()
}
}
Location Model should be:
query("SELECT * FROM locations;"); // if table name is `locations`
return $this->query("SELECT * FROM Location;"); // if table name is `Location` since your public name is `Location`
}
}