CakePHP with Sqlite3: How to connect to multiple sqlite file?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CakePHP with Sqlite3: How to connect to multiple sqlite file?

Banny Muth
I working on a project where user register and get a free online shop using CakePHP v2.6.5. I'm using shared hosting so i can't create Mysql database for them, So I use sqlite instead. Because I need to use it with Mobile App too. In my code I dynamically create sqlite file for user after their register. But I don't know how to change database path in CakePHP. All I know is CakePHP use config in `config/database.php` file, but i can't init it dynamically.

In my `config/database.php` file:
   
    public $sqliteDB = array(
        'datasource' => 'Database/Sqlite',
        'persistent' => false,
        //'database'=>'',
        'prefix' => '',
        'encoding' => 'utf8'
    );

I trying to follow these link:
http://stackoverflow.com/questions/5512327/cakephp-switch-database-using-same-datasource-on-the-fly
and this link
http://stackoverflow.com/questions/13956791/cakephp-cant-change-database-on-the-fly, but I got nothing.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CakePHP with Sqlite3: How to connect to multiple sqlite file?

Banny Muth
I figure out how to deal with this problem. Please visit this link to see the answer: http://stackoverflow.com/questions/33491331/cakephp-with-sqlite3-how-to-connect-to-multiple-sqlite-file/33539027#33539027

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.