Webmastersite.net
Register Log In

How to use more than one database

Comments on How to use more than one database

ngprasad
Member

Usergroup: Customer
Joined: Apr 28, 2008

Total Topics: 5
Total Comments: 21
Posted Apr 28, 2008 - 1:58 AM:

Hi All,

I am using WSN Links software in my website.I need to integrate discussion forums into my website.For discussion forums, I have seperate database is there.How to integrate that database into WSN Links software.i.e how to use more than one database in WSN Links software.

Can you please help me anyone.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Apr 28, 2008 - 2:04 AM:

You would need to use just ONE database.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Apr 28, 2008 - 7:31 PM:

You can use two if you want to make things unnecessarily hard, but using one makes more sense: scripts.webmastersite.net/w...system-integration-75.html
ngprasad
Member

Usergroup: Customer
Joined: Apr 28, 2008

Total Topics: 5
Total Comments: 21
Posted Apr 29, 2008 - 10:33 AM:

Hi Paul,

I need to use separate database not in wsnlinks database.
I have created blacklist database and changed like in config file.But it is not working.
$databasename = 'finewine';
$databasename1 = 'blacklist';
$adb = new db($dbhost, $dbuser, $dbpass, $databasename);
if ($adb->dbh) $connection = $adb->dbh;
$adb1 = new db($dbhost, $dbuser, $dbpass, $databasename1);
if ($adb1->dbh) $connection1 = $adb1->dbh;

How to use more than one database.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Apr 30, 2008 - 1:47 AM:

If you go out of your way to destroy the script by random PHP sabotage for no apparent purpose, it will stop working.
ngprasad
Member

Usergroup: Customer
Joined: Apr 28, 2008

Total Topics: 5
Total Comments: 21
Posted May 27, 2008 - 8:40 AM:

We are decided to use separate database.

I have created new php file,for connecting another database and including in includes/prestart.php.

My code is

$db1=mysql_connect("localhost","root","");
mysql_select_db("blacklist",$db1);

I am receiving below error

"Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\wamp\www\finewine\databases\mysql.php on line 27"

Can you please help me to fix it ASAP.


Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 28, 2008 - 1:40 AM:

Again, don't put stuff in prestart.php or any other file. You're just destroying the script. Go back to the original files. If you want to use a member system from another database you don't edit anything except the one line at the top of the integration file, as explained in the article. It is, however, still wiser to move into the same database for better performance.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.