Friday, September 30, 2011

Re: Can't locate the database?

I could be wrong, but here is my understanding.  You have the default config and the test_default config.  Now.  I was under the impression when I first looked in there that there was a default and test_database that you could change which one you were pointing to based on the project you were working on.  After all, there are instances when you want access to multiple databases at the same time.  I was hoping to set somewhere in my code that I was using cake_posts database and use that as I saw fit.  Is this impossible?

Where I have my cake directory I would like be able to use different database settings as I see fit eventually.

Admittedly, I was short on time and rushed to the very end so that I could practice some of the coding aspect (long story).  But, based on what I described, is it doable?

On Fri, Sep 30, 2011 at 1:07 AM, Ryan Schmidt <google-2010@ryandesign.com> wrote:
I'm actually not sure offhand how to change the database config. Why do you want to? Why not just specify your database details in the $default config?

On Sep 29, 2011, at 21:29, Yves S. Garret wrote:

> The tutorial didn't really tell me how to do that.  Actually, I'm not telling Cake anywhere what DB to use.  How and where can I set that?
>
> On Thu, Sep 29, 2011 at 4:04 PM, Ryan Schmidt wrote:
>> ......so you have a *database* called cake_posts that contains a *table* called posts?
>>
>> Also, in your config I see you have chosen not to set up the $default database config but instead to set up a new config called $cake_posts. Where are you telling CakePHP that you want it to use the new $cake_posts config instead of the $default config?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: