Jump to content

How to assign different DB for IP Pages?


Gauravk

Recommended Posts

Posted

I have some new requirement where we need to add a section in our community with tons of data and we wish to keep that data on a separate DB than the core DB.

If it's possible, appreciate if someone can explain how?

Posted

There's no provision within the software to store any data in an external database, except for the forum archiving feature.

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

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

Posted

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);
}

 

Archived

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

  • Recently Browsing   0 members

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