Wednesday, February 23, 2011

Re: Change the Database at Login by user choice

Interesting!

I could have used this a while ago

On 22 February 2011 08:45, John Andersen <j.andersen.lv@gmail.com> wrote:
You have to look into using the models attribute useDbConfig, see the
CakePHP book at:
http://book.cakephp.org/view/1058/useDbConfig

and applying it in the controllers beforeFilter method depending on
your requirement.
Enjoy,
  John

On 21 Feb., 12:19, andreguerreiro85 <andreguerreir...@gmail.com>
wrote:
> Hi there, i'm using cake 1.2.5 and i need to switch database at login on user
> choice, i have two Databases already defined :
>
>         var $default = array(
>    'driver' => 'mysql',
>         'persistent' => false,
>         'host' => 'localhost',
>         'login' => 'root',
>         'password' => '',
>         //'database' => 'test',
>         'database' => 'testesul2011',
>         );
>
>         var $comercial = array(
>   'driver' => 'mysql',
>         'persistent' => false,
>         'host' => 'localhost',
>         'login' => 'root',
>         'password' => '',
>         'database' => 'test',
>         );
>
> At Login i want to alow users to select one of them at a list and then set
> the database.
> Thanks in advance
> --
> View this message in context:http://cakephp.1045679.n5.nabble.com/Change-the-Database-at-Login-by-...
> Sent from the CakePHP mailing list archive at Nabble.com.

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



--
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk


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