Questions tagged with condition

1 answer

0 votes

Asked by iwanwan, on 2/1/10 in

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

Asked by CrazyGolem, on 29/1/10 in

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

Asked by JacopKane.myopenid.com, 1 month, 1 day ago in

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

Asked by Calimer0, 2 weeks, 6 days ago in

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

Asked by wesert, 6 days, 23 hours ago in

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...

<< previous next >>