Query 2 database

Discussion in 'PHP' started by slaydragon, Jun 11, 2008.

  1. #1
    Hi guys,

    I have 2 different databases. I want to query table A from database 1 and table B from database 2 and display them on a php page. How do i do it? Advices will be appreciated. Thanks Alot..

    :)
     
    slaydragon, Jun 11, 2008 IP
  2. mehmetm

    mehmetm Well-Known Member

    Messages:
    134
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #2
    hi man,

    just use the mysql_select_db function before your other query which process on second database.

    example: mysql_select_db('database2', $connection);

    Regards.
     
    mehmetm, Jun 11, 2008 IP
    slaydragon likes this.