Jump to content

Recommended Posts

Posted

To make this short, as a developer I've ran into situations where I've had to connect to a different database within Blesta before.  Right now I'm having to manage the PDO stuff myself, which gets ugly and troublesome.

 

Basically what I would like to see is the ability to use the Record class to connect to more than just the Blesta database.

Posted

$db_info = array(
'driver' => "mysql",
'host' => "yourmysqlserver.com",
'database' => "database_name",
'user' => "database"user",
'pass' => "password_database",
'persistent' => false, // or true
'charset_query' => "SET NAMES 'utf8'",
'options' => array()
);

$remote_database = new Record($db_info);

 

Posted
  On 9/12/2014 at 12:01 AM, naja7host said:

$db_info = array(
'driver' => "mysql",
'host' => "yourmysqlserver.com",
'database' => "database_name",
'user' => "database"user",
'pass' => "password_database",
'persistent' => false, // or true
'charset_query' => "SET NAMES 'utf8'",
'options' => array()
);

$remote_database = new Record($db_info);

Has this worked for you?  Didn't know this is how the PDO objects were created in Blesta.

Posted
  On 9/12/2014 at 12:03 AM, secforus_ehansen said:

Has this worked for you?  Didn't know this is how the PDO objects were created in Blesta.

i have not tested , but i have inspired from the migrator plugin . it should work .

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...