Quantcast
Channel: [PHP] How to retrieve the connection status in PHP?
Browsing all 10 articles
Browse latest View live

[PHP] How to retrieve the connection status in PHP?

Hi All, I'd like to know if there is a way to retrieve a connection status in PHP. Currently, I have to commit a query without knowing if a connection is open or closed. The best strategy should be: 1....

View Article



[PHP] How to retrieve the connection status in PHP?

I think you are right, there is no way to retrieve the the connection status... I also inspected the source code of the PHP driver. However, your advice in a previous postcan be exploited to mitigate...

View Article

[PHP] How to retrieve the connection status in PHP?

Got it. It seems like the PHP SQL Server driver is missing a way to get the connection status from your SQL Server. I will log this request with the engineering team.Apologies for the inconvenience. As...

View Article

[PHP] How to retrieve the connection status in PHP?

Hi Meet Bhagdev,thanks for your reply.Your function is actually the "standard" way to connect to an Azure SQL server, but does not answer to my question. 

View Article

[PHP] How to retrieve the connection status in PHP?

Here is how I would create a function like this:function OpenConnection() { try { $serverName = "tcp:myserver.database.windows.net,1433"; $connectionOptions =...

View Article


[PHP] How to retrieve the connection status in PHP?

Hi Meet Bhagdev, thanks for your reply. Actually there is no OpenConnection in the PHP driver.

View Article

[PHP] How to retrieve the connection status in PHP?

Hello dsmwb,I did some some more research. Wit the PHP driver, you can do the following:$conn =OpenConnection();Once you have the $conn variable, you can check if it is true or false. That can tell you...

View Article

[PHP] How to retrieve the connection status in PHP?

Hi Meet Bhagdev, thanks for your suggestion. However, your approach is a workaround and does not reply to my question. A cheap query is still a query and with this approach the number of queries is...

View Article


[PHP] How to retrieve the connection status in PHP?

Hello dsmwb,That seems like the right approach. Here is what I would do: run a cheap SQL select such as SELECT GETDATE() on the open connection, catch any SqlException that is thrown, check and...

View Article


[PHP] How to retrieve the connection status in PHP?

Hi All, I'd like to know if there is a way to retrieve a connection status in PHP. Currently, I have to commit a query without knowing if a connection is open or closed. The best strategy should be: 1....

View Article
Browsing all 10 articles
Browse latest View live




Latest Images