hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : quick php/mysql ?
Reply

Forum Jump

quick php/mysql ?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 03-09-2003, 12:28 AM
Lippy Lippy is offline
Web Hosting Master
 
Join Date: Nov 2002
Posts: 736

quick php/mysql ?


Just a real quicky, I am teaching myself how to code in php, and use mysql through it. I have come to a question that I haven't really gotten a definite answer for. Can you use 2 different mysql databases on the same page?

If you can would you be so kind as to offer links as to where I could find any information on any special techniques required to do so if they exsist. Thank you

__________________
LipWeb.Net
"Less Lip More Service"
Providing Quality Hosting at Fair Prices
AIM: LipWebNet MSN: daniel[at]lipweb.net [color=red]



Sponsored Links
  #2  
Old 03-09-2003, 12:53 AM
Jordan JR Jordan JR is offline
Disabled
 
Join Date: Mar 2003
Location: PHP =)
Posts: 110
**** it slipped my mind
im sure u can
using teh connect and close fucntions i guess

  #3  
Old 03-09-2003, 03:52 AM
ruler ruler is offline
WHT Addict
 
Join Date: Jul 2002
Posts: 148
i havent tried this in a long time, but something like this should work according to the php manuals..

PHP Code:
$server1 mysql_connect("host""username""pass");
$dbserver1 mysql_select_db("server1");
$server2 mysql_connect("host2""username""pass");
$dbserver2 mysql_select_db("server2");

$query mysql_query("SELECT * FROM test"$server1); // server1

$query2 mysql_query("SELECT * FROM Test2"$server2); // server2
$res1 mysql_fetch_array($query); // $res1 is the array containing data from the test table
$res2 mysql_fetch_array($query2); // $res2 is the array containg data from the Test2 table.
echo "<pre>server1: <BR>" print_r($res1) . "<BR> server2:" print_r($res2) . "</pre>";

mysql_close($server1);
mysql_close($server2); 

Sponsored Links
  #4  
Old 03-09-2003, 09:03 AM
Lippy Lippy is offline
Web Hosting Master
 
Join Date: Nov 2002
Posts: 736
thanks for the help.

__________________
LipWeb.Net
"Less Lip More Service"
Providing Quality Hosting at Fair Prices
AIM: LipWebNet MSN: daniel[at]lipweb.net [color=red]

Reply

Related posts from TheWhir.com
Title Type Date Posted
Tesora's OpenStack DBaaS Supports MongoDB, Cassandra, Redis, and MySQL Web Hosting News 2014-05-23 14:53:11
Google Releases Hosted Database Service Cloud SQL to General Availability Web Hosting News 2014-02-12 13:46:02
Google Cloud Provides Support For Native MySQL Connections Web Hosting News 2013-11-01 14:36:06
Web Hosting Sales and Promos Roundup - September 20, 2013 Web Hosting News 2014-05-23 15:42:47
PHP And MySQL Scaling: Preparing A Startup For Growth Blog 2014-04-24 13:27:35


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?