1 answer
0 votes
find conditions
hi all,
Ho do I create this sql with cakephp
SELECT `item`.`id`, `item`.`name_1`, `item`.`name_2`
FROM `item`
WHERE `item`.`name_1` != `item`.`name_2`
Thanks
3 answers
0 votes
Set find() conditions in the model
Hi everybody, I'm brand new to CakePHP and I'm discovering with pleasure its features :)
Is there a "Model property"-like manner (or a property; I couldn't find one in the API doc) to set the find 'fields' and 'conditions' conditions ?
Instead of...
2 answers
0 votes
I can't get a user data condition requested with a null and spesific id
<?php
function someController()
{
$user_id = $this->Session->read('Auth.User.id');
$this->Announcement->recursive = 1;
$this->paginate = array
(
'conditions' => array
(
'Announcement.user_id' => array($user_id,null)
),
'limit'... 1 answer
0 votes
CakePHP paginate conditions in derived fields how?
Hello, i would like to paginate a list of games, where the sport is a chosen sport.
the relatition is as followed:
Game BelongsTo Competition BelongsTo Team BelongsTo sport
What i would like to do is show all games where the teams sport_id = 1.
The...
2 answers
0 votes
multiple LIKE conditions
Hello!
Could you, please, tell me if it is possible to query model table with multiple LIKEs?
I need something like that:
select FirstName, LastName from users
where (FirstName LIKE '%a' OR FirstName LIKE '%b' OR FirstName LIKE '%c')
AND (LastName...
3 answers
0 votes
conditional add
Is it possible to add a condition to the add and update methods?
for example could you add a condition to check that a field value that is about to be added doesnt already exist in the table?
thanks.
0 answers
0 votes
OR conditions array in find cakephp sql query
Hello,
Cake Version using: 1.2.5 stable
about: OR and multiple and conditions in find query
Query:
$conditions = array("Event.status" = 1 ,
"OR" = array('Event.eventstartdate <=' = $startDate1,
'Event.eventstartdate <=' = $startDate2 ) ,
"OR" =...
1 answer
0 votes
model conditions
I am trying to set conditions on relationships in a model to better filter records returned in finds. If I specify conditions on which users are returned in a $this-Post-find('list) call I'm still getting all the records returned instead of the...
1 answer
0 votes
Peut-on donner une condition par défaut sur un modèle ?
salut,
Je n'ai pas trouvé comment faire pour ajouter une conditions par défaut sur un modèle (plus exactement pour les tous find() qu'on fera par la suite dessus ), un peu comme l'attribut $order = "nom_du_champ ASC".
Sinon je sais qu'on peut déjà...
1 answer
0 votes
View content depending on a variable set in Controller
Hi there,
I don't know how to this in a cakish and clean way :)
I do some processing in foo() action in a controller Bar.
I set some variables to echo them in the foo.ctp view.
function foo() {
...
some processing
...
... 0 answers
0 votes
Pagination.
Hi all,
I am stuck on pagination. I am trying to paginate feePayment records based on certain criteria.
feePayments belongs to Students which in turn belongs YearGroups.
I want to paginate 'unpaid' feePayments for each year group. The problem I am...