Complex Query Question

2009-03-28 Thread bakerLeo

I am stuck on a query problem :
These are the tables involved :

Group
id
name

User
id
name

Groups_Users   (for HABTM)
   id
   group_id
   user_id

Now i have an admin system that lets the admin view the group and all
the related users.
Which is working fine. However, I want to do the OPPOSITE.
View the group and display ALL the users that are not in that group.
How would I structure my $find statement?

Obviously, this is wrong but it is what i need it to do :
$users = $this-User-find('all',array('conditions'=

array('NOT'=array('User.id' =
'GroupsUser.user_id')))

);

This next set of code, is what i want it to do, but not have to
explicitly declare the user ids
This would return all users NOT 1,2,3,4.

$filter = array(1,2,3,4);
 $users = $this-User-find('all',array
('conditions'=
 array('NOT'=array('User.id' =
$filter)))
);

would appreciate all help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Running bake on a remote server using console

2009-02-01 Thread bakerLeo

 I started learning cakePHP just recently and I just completed my
first project. However, I need some help now that I've started
deploying it on my remote server. So far I've only worked at home on a
windows machine. I am not familiar with console commands and have only
so far used cygwin to run cake's bake commands and schema create db
command to create ACL tables. However I'm not sure how I would do this
for my remote server although I'm sure there is a way. I hope someone
could help me out.

$alias cake=php c:/htdocs/cakesample/cake/console/cake.php

How would I go about changing this path to point to my remote server?

Thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---