How to Check Whether mysqli connection is open before closing it

后端 未结 7 1828
野趣味
野趣味 2021-02-04 00:30

I am going to use mysqli_close($connection) to close the $connection. But Before Closing I need to ensure that the concerned connection is open.

<
7条回答
  •  囚心锁ツ
    2021-02-04 01:36

    Got to check if there is a connection before ping

    CAUTION!!!

    ALWAYS do your job and explicity close your connection because other things may go wrong before php closes it by script ending

提交回复
热议问题