multiple database select

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vssp
    Contributor
    • Jul 2006
    • 268

    #1

    multiple database select

    Hi friends

    In my application i need to connect multiple database.First i connect one database and got the value then i connect another database to insert the values . If any possible to two database to connect single application .

    Please send me your suggestion .


    Thanks
    vssp
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    depends on the application and language its written in.

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Following is a quote from an entry in the php.net documentation for mysql_select_db :

      matsko at rogers dot com 10-May-2006 09:19
      Just incase the mysql_select_db () function still won't work with multiple database connections (as has happened to me before).

      $dbh1 = mysql_pconnect( $host,$user,$pa ss);
      $dbh2 = mysql_pconnect( $host,$user,$pa ss);

      You could do this...

      mysql_query("US E database1",$dbh 1);
      mysql_query("Us e database2",$dbh 2);

      This does the same thing as the mysql_select_db () function...

      or this...

      You don't even have to select the database for each connection.

      mysql_query("SE LECT * FROM database1.table ",$dbh1);
      mysql_query("SE LECT * FROM database2.table ",$dbh2);
      Ronald :cool:

      Comment

      • vssp
        Contributor
        • Jul 2006
        • 268

        #4
        Thanks friends

        Comment

        Working...