Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts

    consult on two db

    How I can make a consult between two databases using the same connect.php file?

    Regards

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    When you connect to the database do something like:
    PHP Code:
    $db1 mysql_connect();
    $db2 mysql_connect(); 
    then in the mysql_query function:
    resource mysql_query ( string query [, resource link_identifier] )
    you can state which database to use ($db1 or $db2) using the resource link_identifier.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •