Blog Post

Azure Database Support Blog
1 MIN READ

Lesson Learned #153: PHP Console Script for Testing connection in Azure SQL

Jose_Manuel_Jurado's avatar
Dec 10, 2020

To connect to Azure SQL Database we could use multiple tools or coding languages like C#, PHP, Java, etc.. In some situations, we need to test our application, for example, how much time take a single connection, review my retry-logic, review the connection, etc.. 

 

In this URL you could find an example about several operations that you could use using PHP. 

 

This application has been designed with a main idea: how to obtain information about the elapsed time in the connectivity process and the query execution to a database of Azure SQL Database using PHP ( ODBC or Microsoft Drivers for PHP for SQL Server). This PHP console script runs in Windows and Linux.

 

This PHP console script has the main features:

  • Connect using different driver measuring the time spent.
  • Once you have established the connection runs multiple times the query SELECT 1 measuring the time spent.
  • Once you have established the connection runs multiple times any query that you need with a random parameter measuring the time spent.
  • Check if the port is open.
  • Report all the ports that the client has opened.
  • All the operations will be saved on a file called Output.log.

You could find the instrucctions in readme file.

 

As always, all feedback and contributions are very welcome.

 

Enjoy!

 

Updated Dec 10, 2020
Version 2.0
No CommentsBe the first to comment