Jump to content

How to assign different DB for IP Pages?


Gauravk

Recommended Posts

52 minutes ago, bfarber said:

You can do this with customizations by passing different details to the database handler library easily.

 

Can you please elaborate on this, how to do that as a novice user or do I need a programmer to edit this request?

Secondly, if this multi DB system will slow down anything although DB will be on the same physical server.

Link to comment
Share on other sites

Using a secondary database connection in and of itself won't slow anything down - that largely depends upon your server configuration and specifications.

You will need a programmer to do this.

$database = \IPS\Db::i( 'mycustomdatabase', array(
	'sql_host'		=> ...,
	'sql_user'		=> ...,
	'sql_pass'		=> ...,
	'sql_database'	=> ...,
	'sql_port'		=> ...,
	'sql_socket'	=> ...,
	'sql_tbl_prefix'=> ...,
	'sql_utf8mb4'	=> isset( \IPS\Settings::i()->sql_utf8mb4 ) ? \IPS\Settings::i()->sql_utf8mb4 : FALSE
) );

foreach( $database->select( '*', 'mytable' ) as $row )
{
	print_r($row);
}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...