Why specify an explicit database connection?

I make a simple blog for myself and, reading the PHP manual, found this http://us2.php.net/manual/en/function.pg-query.php

It says

pg_query resource ([resource $ connection], line $ query)

...

Note. Although the connection can be omitted, it is not recommended, because it can be a reason for finding errors in scripts.

Why is it not normal to use the last connection? I never planned to have more than one connection open to a PHP script, since this could cause errors for me?

+3
source share
3 answers

Hah "I never planned to have more than one open connection in a PHP script."

, . " . , . . - , ? dot-com." !" . , .

... , . , , - . , . ! , . , . . ... ! ? . . . . ! !

. , pg_query , . . ... . . ...

* sniff *

+13

, . , :) , .

+1

, ? , mysql_query(). PostgreSQL - , .

, .

0
source

Source: https://habr.com/ru/post/1728136/


All Articles