Help - Search - Members - Calendar
Full Version: External DB
Invision Power Services > Community Forums > Community Web Design and Coding
simpsoholic
Can i use the normal IPB registration page to insert the user into a different DB?
Grant
IPS Beyond would probably be better suited to answer that question.

http://www.ipsbeyond.com
Michael Boutros
Do you mean it inserts into two different databases? Or into a database hosted on another server/account?
simpsoholic
i mean that it inserts in into a different DB hosted on the same server wink.gif
simpsoholic
Or 2 Databases, it doesnt really matter
marcele
QUOTE(simpsoholic @ Apr 16 2006, 08:31 PM) *
Can i use the normal IPB registration page to insert the user into a different DB?


Yes this is easy.. just create a different db object:

E.G.
CODE
//connect to a remote db
$this->ipsclass->RDB = new db_driver();
$this->ipsclass->RDB->obj['sql_database']         = $this->ipsclass->vars['remote_database'];
$this->ipsclass->RDB->obj['sql_user']                = $this->ipsclass->vars['remote_user'];
$this->ipsclass->RDB->obj['sql_pass']               = $this->ipsclass->vars['remote_pass'];
$this->ipsclass->RDB->obj['sql_host']               = $this->ipsclass->vars['remote_host'];
$this->ipsclass->RDB->obj['sql_tbl_prefix']         = $this->ipsclass->vars['remote_tbl_prefix'];
$this->ipsclass->RDB->obj['use_shutdown']         = 0;
$this->ipsclass->RDB->obj['force_new_connection'] = 1;
$this->ipsclass->RDB->connect();


Then do your inserts with the new object ..

Then call this to close your remote connection.

CODE
$this->ipsclass->RDB->close_db();
simpsoholic
Sorry, im a complete PHP newb...
Where do i put this?
marcele
QUOTE(simpsoholic @ Apr 19 2006, 02:42 AM) *
Sorry, im a complete PHP newb...
Where do i put this?


If you are new to PHP then you probably shouldn't try inserting data into a remote db ... I would just hire someone to do it original.gif
simpsoholic
Dont have the money
simpsoholic
But thanks very much for your suggestions
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.