Re: How to accomplish SELECT [not *] and WHERE clause?

2006-05-05 Thread [EMAIL PROTECTED]

findAll is only for performing a select on all or certain fields with
where clause.
findBySQL is deprecated.  Use query instead.
It also looks like query can be cached and execute cannot.

And if you are doing joins then I would SERIOUSLY recommend the
associations.


--~--~-~--~~~---~--~~
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: How to accomplish SELECT [not *] and WHERE clause?

2006-05-05 Thread calzone

Thank you, it looks like that's the stuff I need!


--~--~-~--~~~---~--~~
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: How to accomplish SELECT [not *] and WHERE clause?

2006-05-04 Thread BoBB
If you check out the API entry for findAll[1] there are function parameters that should be able to do anything you might want with the queries. As far as doing JOIN queries and the like I would recomend checking out the association features in cake. The best resource I have found to explain that is the Model section[2] in the manual[3]. I had a hard time understanding the associations until I read section 3 of that page in the manual and it all just kinda clicked.
[1] http://api.cakephp.org/class_model.html#c2d8fb14f5398c85452d978bd013436f[2] 
http://manual.cakephp.org/chapter/6[3] http://manual.cakephp.orgOn 5/4/06, calzone 
[EMAIL PROTECTED] wrote:ok, so although I'm pretty seasoned with php itself, I'm 100% pure cake
newbie, and this is likely answered somewhere, but I just haven't foundit yet. Not in the manual, not in the wiki, and not here in this group.This seems to be ripe for an entry in an FAQ somewhere though.
Here's the deal: I just completed the blog tutorial and it occurred tome that this is all very nice but... the findAll() method seems tosimply return every single column and every single row from thedatabase, while, the read() method seems to be just for the purposes of
returning all columns for one record.This seems horribly inefficient.I'm positive there must be a way torefine these queries somehow under cake and I'm just bumbling in thedark.I'd like to be able to only grab a certain number of columns, or
perhaps a count of records or a sum of records.I'd like to be able toask the database to return only records that match a certain criteria,or only to update records matching a certain criteria.Also, I'd like
to be able to create inner and outer joins across several tables andeven databases if need be.I'm sorry, but I just don't get how to use cake for all of that.I'mcurrently trying to set about rewriting some of my existing websites
under cake, and there is all sorts of database logic going on.I'mguessing there's probably a lot of built in methods that handle a lotof this stuff, as well as possibly a method to pass a custom query?Yes? No?
Any help or direction is much appreciated!

--~--~-~--~~~---~--~~
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: How to accomplish SELECT [not *] and WHERE clause?

2006-05-04 Thread [EMAIL PROTECTED]

there is a findBySQL method also, which allows you to put in any SQL
you want, wouldn't that work?  I think the documentation on this
function is messed up, but it should work.

Also, you can pass any conditions, I think, to the findAll function to,
so I think  you could put together joins.


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