Re: Run Queries Unrelated to Controller

2008-12-28 Thread ache...@gmail.com
There really are very few downfalls to running raw SQL other than that you have to write it by hand and people tend to do it in a poor fashion. There are lots of cases where raw SQL is by far the best way to go about pulling data but there are a few things to remember. There area few pitfalls

Re: Run Queries Unrelated to Controller

2008-12-27 Thread Webweave
Your original post showed 'uses' for the tables in question, which infers that you don't have them linked to the controller's model. If they are connected, you may not have recursive set properly to cause Cake to include them. Cake needs to understand how the tables get joined in order to build

Re: Run Queries Unrelated to Controller

2008-12-27 Thread Chad Casselman
Can someone explain this to me please. I need to under cakephp better in order to really leverage it. If I just run find all, then everything is fine I get data back in the format below which is fine; however, if I pass in fields (only need 3 fields from all that information) as in the previous

Re: Run Queries Unrelated to Controller

2008-12-27 Thread Arthur Pemberton
On Sat, Dec 27, 2008 at 12:39 PM, Chad Casselman ccassel...@gmail.com wrote: Can someone explain this to me please. I need to under cakephp better in order to really leverage it. If I just run find all, then everything is fine I get data back in the format below which is fine; however, if I

Re: Run Queries Unrelated to Controller

2008-12-27 Thread Chad Casselman
So does than mean I can't run MySQL commands beyonds selects or just for this one example? How do I do run MySQL commands in cakephp, or do I just run raw sqls? What is the downfall of running raw SQL? Chad On Sat, Dec 27, 2008 at 2:06 PM, Arthur Pemberton pem...@gmail.com wrote: On Sat,

Re: Run Queries Unrelated to Controller

2008-12-27 Thread Arthur Pemberton
On Sat, Dec 27, 2008 at 1:09 PM, Chad Casselman ccassel...@gmail.com wrote: So does than mean I can't run MySQL commands beyonds selects or just for this one example? I never said you can't do it, just said it would be easier. Consider that you know everything necessary to do the calculations

Run Queries Unrelated to Controller

2008-12-26 Thread Chad Casselman
I have a Controller for Jobs with a model Job. When I hit /jobs (the index function of Job Controller), I need to run a query on 2 other tables (not joined to Job) to find values to manually insert into jobs before actually displaying the index. I have tried several things but can't seem to

Re: Run Queries Unrelated to Controller

2008-12-26 Thread Arthur Pemberton
On Fri, Dec 26, 2008 at 5:14 PM, Chad Casselman ccassel...@gmail.com wrote: I have a Controller for Jobs with a model Job. When I hit /jobs (the index function of Job Controller), I need to run a query on 2 other tables (not joined to Job) to find values to manually insert into jobs before

Re: Run Queries Unrelated to Controller

2008-12-26 Thread Chad Casselman
Should it bring in all hardcoded (model) associations when I import them? Here is what I have and I can't pull any fields from Sequences or PackagesSequence objects/tables var $uses = array('Package','Sequence','PackagesSequence'); $extra = array( 'recursive' = 1, //int

Re: Run Queries Unrelated to Controller

2008-12-26 Thread Arthur Pemberton
On Fri, Dec 26, 2008 at 7:40 PM, Chad Casselman ccassel...@gmail.com wrote: Should it bring in all hardcoded (model) associations when I import them? Here is what I have and I can't pull any fields from Sequences or PackagesSequence objects/tables var $uses =

Re: Run Queries Unrelated to Controller

2008-12-26 Thread Webweave
In order to fetch data from both tables, you need to join them, Cake won't do this automagically. On Dec 26, 5:40 pm, Chad Casselman ccassel...@gmail.com wrote: Should it bring in all hardcoded (model) associations when I import them? Here is what I have and I can't pull any fields from