Connecting multiple database and join query across database in php

后端 未结 2 1280
灰色年华
灰色年华 2020-12-21 11:07

Using php i wants to make a join query across 2 database.

This is my first connection.

$conn = mysql_connect(\'localhost\',\'root1\',\'pass1\'); 
@my         


        
2条回答
  •  伪装坚强ぢ
    2020-12-21 11:24

    The mysql module in the php environment doesn't support multiple database connections, and, besides, this module exists only for retrocompatibily reasons. You shouldn't use it.

    mysqli and PDO are better, more complete (these support transaction and prepared statement, "mysql" don't), and PDO support also the multi-db query.

    The old mysql is procedural only, mysqli can be used in procedural and OO programming, PDO is OOP.

提交回复
热议问题