Re: Filtering Data

2006-08-19 Thread [EMAIL PROTECTED]

sam D,

really you want to avoid the custom sql (using -query) as much as
possible

Why? That method seems to work fine. I use query().

Please elaborate.

Ralph


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Re: Filtering Data

2006-08-19 Thread Samuel DeVore

Oh I use it too, I just try to avoid it because I don't want to create
too many dependancies to a particular DB engine, it is far too easy
for me to put mysql specific syntax in there then I loose the
portability that a database abstraction layer buys me.


Now if I was very instinctive about using pure 'sql' I wouldn't worry
too much about it...

IMHO,
   Sam D
On 8/19/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 sam D,

 really you want to avoid the custom sql (using -query) as much as
 possible

 Why? That method seems to work fine. I use query().

 Please elaborate.

 Ralph


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Filtering Data

2006-08-18 Thread c_doug

Thanks, I'll try that as soon as I get a chance. Can you please tell me
how (or if it is possible) to have multiple conditions in the array?
Similar to: WHERE category_id = 1 AND author = 'me'.

Also at what point of complexity or when is it just better to use SQL
in your model?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Filtering Data

2006-08-18 Thread Mikee Freedom

what about the HABTM associations., is there an easy method to filter
information based on values in the join table?

e.g. User and Group models using groups_users

function index()
   {
   $conditions = array('Group.id' = 2);
   $this-data = $this-User-findAll($conditions);
   }

On 19/08/06, Samuel DeVore [EMAIL PROTECTED] wrote:
 array('Post.category_id'=$id,'Post.author'='me')

 you can also have ,  and stuff like that just put it like
 'Post.category_id'=' ' + $id

 for a strange one.

 really you want to avoid the custom sql (using -query) as much as possible
 IMHO  read the manual section on model for more information
 http://manual.cakephp.org/chapter/models

 your conditions can be an array or a string (I tend to prefer the array
 notation)

 sam D




  On 8/18/06, c_doug [EMAIL PROTECTED] wrote:
 
  Thanks, I'll try that as soon as I get a chance. Can you please tell me
  how (or if it is possible) to have multiple conditions in the array?
  Similar to: WHERE category_id = 1 AND author = 'me'.
 
  Also at what point of complexity or when is it just better to use SQL
  in your model?
 
 
 
   
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Filtering Data

2006-08-18 Thread c_doug

Btw, the above example worked. Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---