Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:38:03+00:00 2026-06-11T21:38:03+00:00

the thing is i have two tables in two different databases let’s call them

  • 0

the thing is i have two tables in two different databases let’s call them A and B.
in database A we have table1 and in database B we have table2. the primary key of table1 is a foreign key in table 2. So i need to use a join query to extract data from the two databases in the same time. Or using PDO you can not connect to two databases using the same pdo object !

$bdd = new PDO(‘mysql:host=localhost;dbname=A’, ‘root’, ‘12345’);

so what can i do ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:38:04+00:00Added an answer on June 11, 2026 at 9:38 pm

    You should be able to do something like:

    SELECT *
    FROM t1
    LEFT JOIN otherDB.t2 on otherDB.t2.t1_fk = t1.id
    

    Provided the user has relevant permissions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different database. One of them, original database and another one is
Let's say I have two Databases like so : DatabaseA create table Table1 (
I have two different databases that contain two tables with the exact same design.
I came around some weird thing in MS SQL server. I have two tables
I have a database that has two tables, these tables look like this codes
Let's say I don't have more than one or two dozen objects with different
I have two tables in a database. Table 1 includes an order number which
I have two tables representing two different types of imagery. I am using PostGIS
I have a page (let's call it edit page) with two forms - the
Sometimes I have to delete two records on different tables. How could I execute

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.