Is there a way to share object between php pages?

后端 未结 5 1142
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 22:17

I am new to php, but in other web technologies, you can share objects between page instances. For example, in java jsp pages you easily have on class that exist as static cl

5条回答
  •  鱼传尺愫
    2020-12-14 22:25

    Most of the PHP database libraries use connection pooling already. You call, for example, pg_connect as if you were requesting a new connection, but if the connection string is the same as a connection that already exists, you will get the established connection back instead. If you only care about pooling for database access, then you can just confirm that it exists in the db library you're using.

提交回复
热议问题