PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
vivekjain
Forum Commoner
Posts: 76 Joined: Thu Jan 08, 2004 12:38 am
Post
by vivekjain » Mon Sep 12, 2005 9:03 am
Hi,
I would like to know if I can connect to 2 different database using PHP. I need to access different tables from different database.
Thanks
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Mon Sep 12, 2005 9:13 am
have you tried it?
vivekjain
Forum Commoner
Posts: 76 Joined: Thu Jan 08, 2004 12:38 am
Post
by vivekjain » Mon Sep 12, 2005 9:19 am
yes, I am getting this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Sep 12, 2005 9:26 am
very very likely, you have an error in your query syntax.
mysql_error()
BDKR
DevNet Resident
Posts: 1207 Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:
Post
by BDKR » Mon Sep 12, 2005 11:38 am
LOL! You may want to check that you connect with success before going forward with the query.
vivekjain
Forum Commoner
Posts: 76 Joined: Thu Jan 08, 2004 12:38 am
Post
by vivekjain » Tue Sep 13, 2005 12:32 am
It works now, I had to use the databse name.tablename and it worked.
thanks