Number of connections in a PHP script

This may sound very obvious.

I have 3 databases, all on the same server.

If I need to use them in a PHP script, should I make a connecton for each of them:

(1) connect and select db1
(2) query db1
(3) connect and select db2
(4) query db2
(5) query db2
(6) query db1 (connection 1)
(7) connect and select db3
(8) query db3

or should I make one connection only and then select each db as needed

(1) connect db1
(2) select db1
(3) query db1
(4) select db2
(5) query db2
(6) select db1
(7) query db1
(8) select db3
(9) query db3

Use just the one connection, connecting to a database takes a lot more time than switching databases using an existing connection.