Multople db's, one script.

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
Jimbob
Forum Newbie
Posts: 2
Joined: Tue Nov 26, 2002 3:37 pm

Multople db's, one script.

Post by Jimbob »

Is there any problem with using two or more databases from within a single script, and switching between the db's many times?

What's the best way to switch? using mysql_change_user and mysql_select_db?

Ty,
Jon Crouch.
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

actually, you can do it right inside your queries:
example:
SELECT * FROM db_name.table_name
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

They both work great, but i suggest the second one. =)
Post Reply