#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    2
    Rep Power
    0
    I would like to connect to two different mysql databases on two different machines and run a query using tables from these two different DB's.
    Is that possible directly or should I store a query on DB1 first as a temp table in DB2 and then run a query against a table in DB2 and the temp. table?
    I use PHP4 and Apache 1.3.12.

    I hope someone can help me on the way.

    VidJa
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    You can join tables in different databases on the same machine but not on different machines. You'll need two seperate queries.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    2
    Rep Power
    0
    and how can I do that, I'm pretty new to PHP, MySQL and SQL in particular.

  6. #4
  7. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    Well, that really depends on what you are trying to do. What information in the first database affects what you are trying to do in the second and how, etc.

Similar Threads

  1. Syntax error in INSERT INTO query
    By Lee Miles in forum Visual Basic Programming
    Replies: 6
    Last Post: December 19th, 2003, 07:37 AM
  2. checkbox insert query
    By numb in forum PHP Development
    Replies: 11
    Last Post: December 15th, 2003, 11:10 AM
  3. nested query
    By buckenmeyer in forum PHP Development
    Replies: 4
    Last Post: November 26th, 2003, 03:45 PM
  4. Replies: 5
    Last Post: December 13th, 2001, 06:24 PM
  5. Replies: 1
    Last Post: December 13th, 2001, 03:18 PM

IMN logo majestic logo threadwatch logo seochat tools logo