Multiple databases

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Sonic98
Forum Newbie
Posts: 16
Joined: Tue Dec 17, 2002 8:55 pm
Contact:

Multiple databases

Post by Sonic98 »

Is it possible to connect to more than one database at once? For instance can I check the see if a certain record exists in one database, and if it exists, go ahead and do the action that is being asked on the current database.

For example let's say I have a database that stores everyone that logs into my chatroom. Can I have it check to see how many people who logged into my chatroom are actually members of my websites

(not code)
Check if chatdatebase/logged people/login name = sitedatabase/memberlist/membername?
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

Problems arise with that. How do you know that the person in the chatroom doesnt have the same name as the site member. If the chatroom doesn't have any name restrictions and doesn't require membership registration then you're going to have people wo can have the same name.

Get what i'm saying?
Sonic98
Forum Newbie
Posts: 16
Joined: Tue Dec 17, 2002 8:55 pm
Contact:

Post by Sonic98 »

That's the whole point. I don't care if they are really a member of my site or not. I just want to see how often a certain name comes into the chatroom. I'm not trying to compile staticis. This just an example. I just want to know how to compare values in two different databases.
Beans
Forum Commoner
Posts: 49
Joined: Mon Dec 23, 2002 3:06 am
Location: Manila, Philippines
Contact:

Post by Beans »

Yes. This is very much possible. Just create a new MySQL connection.
Post Reply