diff --git a/samples/tutorials/php/2.0 PHP Server programming - Stored procedures, Transactions, and UDFs/test.php b/samples/tutorials/php/2.0 PHP Server programming - Stored procedures, Transactions, and UDFs/test.php index aca4c35f..22b2d562 100644 --- a/samples/tutorials/php/2.0 PHP Server programming - Stored procedures, Transactions, and UDFs/test.php +++ b/samples/tutorials/php/2.0 PHP Server programming - Stored procedures, Transactions, and UDFs/test.php @@ -5,9 +5,9 @@ $connectionOptions = [ "Uid" => "yourusername", "PWD" => "yourpassword", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); -//////////////////STORED PROCEDURE///////////////////////// +////////////////// STORED PROCEDURE ///////////////////////// $tsql = "CREATE PROCEDURE sp_GetCompanies22 AS BEGIN SELECT [CompanyName] FROM SalesLT.Customer END"; $storedProc = sqlsrv_query($conn, $tsql); if ($storedProc == false) { @@ -17,9 +17,9 @@ if ($storedProc == false) { sqlsrv_free_stmt($storedProc); $tsql = "exec sp_GETCompanies22"; -//Executes the query +// Executes the query $getProducts = sqlsrv_query($conn, $tsql); -//Error handling +// Error handling if ($getProducts == false) { echo "Error executing Stored Procedure"; die(FormatErrors(sqlsrv_errors())); @@ -30,7 +30,7 @@ $ctr = 0;

First 10 results are after executing the stored procedure:

9) { break; } @@ -50,7 +50,7 @@ if ($storedProc == false) { sqlsrv_free_stmt($storedProc); ?> "); while ($row = sqlsrv_fetch_array($getProducts, SQLSRV_FETCH_ASSOC)) { - //Printing only the top 10 results + // Printing only the top 10 results if ($ctr > 9) { break; } diff --git a/samples/tutorials/php/RHEL/SqlServerColumnstoreSample/columnstore.php b/samples/tutorials/php/RHEL/SqlServerColumnstoreSample/columnstore.php index 7c67b8bf..aea376af 100644 --- a/samples/tutorials/php/RHEL/SqlServerColumnstoreSample/columnstore.php +++ b/samples/tutorials/php/RHEL/SqlServerColumnstoreSample/columnstore.php @@ -7,10 +7,10 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); -//Read Query +// Read Query $tsql = "SELECT SUM(Price) as sum FROM Table_with_5M_rows"; $getResults = sqlsrv_query($conn, $tsql); echo("Sum: "); diff --git a/samples/tutorials/php/RHEL/SqlServerSample/connect.php b/samples/tutorials/php/RHEL/SqlServerSample/connect.php index 7b61b107..4ea7a995 100644 --- a/samples/tutorials/php/RHEL/SqlServerSample/connect.php +++ b/samples/tutorials/php/RHEL/SqlServerSample/connect.php @@ -5,7 +5,7 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); if ($conn) { echo "Connected!"; diff --git a/samples/tutorials/php/RHEL/SqlServerSample/crud.php b/samples/tutorials/php/RHEL/SqlServerSample/crud.php index 31193a94..48cad1c9 100644 --- a/samples/tutorials/php/RHEL/SqlServerSample/crud.php +++ b/samples/tutorials/php/RHEL/SqlServerSample/crud.php @@ -5,10 +5,10 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); -//Insert Query +// Insert Query echo("Inserting a new row into table" . PHP_EOL); $tsql = "INSERT INTO TestSchema.Employees (Name, Location) VALUES (?,?);"; $params = ['Jake', 'United States']; @@ -21,7 +21,7 @@ echo($rowsAffected . " row(s) inserted: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Update Query +// Update Query $userToUpdate = 'Nikita'; $tsql = "UPDATE TestSchema.Employees SET Location = ? WHERE Name = ?"; @@ -36,7 +36,7 @@ if ($getResults == false || $rowsAffected == false) { echo($rowsAffected . " row(s) updated: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Delte Query +// Delte Query $userToDelete = 'Jared'; $tsql = "DELETE FROM TestSchema.Employees WHERE Name = ?"; $params = [$userToDelete]; @@ -49,7 +49,7 @@ if ($getResults == false || $rowsAffected == false) { echo($rowsAffected . " row(s) deleted: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Read Query +// Read Query $tsql = "SELECT Id, Name, Location FROM TestSchema.Employees;"; $getResults = sqlsrv_query($conn, $tsql); echo("Reading data from table" . PHP_EOL); diff --git a/samples/tutorials/php/Ubuntu/SqlServerColumnstoreSample/columnstore.php b/samples/tutorials/php/Ubuntu/SqlServerColumnstoreSample/columnstore.php index 7c67b8bf..aea376af 100644 --- a/samples/tutorials/php/Ubuntu/SqlServerColumnstoreSample/columnstore.php +++ b/samples/tutorials/php/Ubuntu/SqlServerColumnstoreSample/columnstore.php @@ -7,10 +7,10 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); -//Read Query +// Read Query $tsql = "SELECT SUM(Price) as sum FROM Table_with_5M_rows"; $getResults = sqlsrv_query($conn, $tsql); echo("Sum: "); diff --git a/samples/tutorials/php/Ubuntu/SqlServerSample/crud.php b/samples/tutorials/php/Ubuntu/SqlServerSample/crud.php index 31193a94..48cad1c9 100644 --- a/samples/tutorials/php/Ubuntu/SqlServerSample/crud.php +++ b/samples/tutorials/php/Ubuntu/SqlServerSample/crud.php @@ -5,10 +5,10 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); -//Insert Query +// Insert Query echo("Inserting a new row into table" . PHP_EOL); $tsql = "INSERT INTO TestSchema.Employees (Name, Location) VALUES (?,?);"; $params = ['Jake', 'United States']; @@ -21,7 +21,7 @@ echo($rowsAffected . " row(s) inserted: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Update Query +// Update Query $userToUpdate = 'Nikita'; $tsql = "UPDATE TestSchema.Employees SET Location = ? WHERE Name = ?"; @@ -36,7 +36,7 @@ if ($getResults == false || $rowsAffected == false) { echo($rowsAffected . " row(s) updated: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Delte Query +// Delte Query $userToDelete = 'Jared'; $tsql = "DELETE FROM TestSchema.Employees WHERE Name = ?"; $params = [$userToDelete]; @@ -49,7 +49,7 @@ if ($getResults == false || $rowsAffected == false) { echo($rowsAffected . " row(s) deleted: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Read Query +// Read Query $tsql = "SELECT Id, Name, Location FROM TestSchema.Employees;"; $getResults = sqlsrv_query($conn, $tsql); echo("Reading data from table" . PHP_EOL); diff --git a/samples/tutorials/php/Windows/SqlServerColumnstoreSample/columnstore.php b/samples/tutorials/php/Windows/SqlServerColumnstoreSample/columnstore.php index 7c67b8bf..aea376af 100644 --- a/samples/tutorials/php/Windows/SqlServerColumnstoreSample/columnstore.php +++ b/samples/tutorials/php/Windows/SqlServerColumnstoreSample/columnstore.php @@ -7,10 +7,10 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); -//Read Query +// Read Query $tsql = "SELECT SUM(Price) as sum FROM Table_with_5M_rows"; $getResults = sqlsrv_query($conn, $tsql); echo("Sum: "); diff --git a/samples/tutorials/php/Windows/SqlServerSample/connect.php b/samples/tutorials/php/Windows/SqlServerSample/connect.php index 7b61b107..4ea7a995 100644 --- a/samples/tutorials/php/Windows/SqlServerSample/connect.php +++ b/samples/tutorials/php/Windows/SqlServerSample/connect.php @@ -5,7 +5,7 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); if ($conn) { echo "Connected!"; diff --git a/samples/tutorials/php/Windows/SqlServerSample/crud.php b/samples/tutorials/php/Windows/SqlServerSample/crud.php index 5df1926a..c975050b 100644 --- a/samples/tutorials/php/Windows/SqlServerSample/crud.php +++ b/samples/tutorials/php/Windows/SqlServerSample/crud.php @@ -5,10 +5,10 @@ $connectionOptions = [ "Uid" => "sa", "PWD" => "your_password", ]; -//Establishes the connection +// Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); -//Insert Query +// Insert Query echo("Inserting a new row into table" . PHP_EOL); $tsql = "INSERT INTO TestSchema.Employees (Name, Location) VALUES (?,?);"; $params = ['Jake', 'United States']; @@ -21,7 +21,7 @@ echo($rowsAffected . " row(s) inserted: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Update Query +// Update Query $userToUpdate = 'Nikita'; $tsql = "UPDATE TestSchema.Employees SET Location = ? WHERE Name = ?"; @@ -36,7 +36,7 @@ if ($getResults == false || $rowsAffected == false) { echo($rowsAffected . " row(s) updated: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Delete Query +// Delete Query $userToDelete = 'Jared'; $tsql = "DELETE FROM TestSchema.Employees WHERE Name = ?"; $params = [$userToDelete]; @@ -49,7 +49,7 @@ if ($getResults == false || $rowsAffected == false) { echo($rowsAffected . " row(s) deleted: " . PHP_EOL); sqlsrv_free_stmt($getResults); -//Read Query +// Read Query $tsql = "SELECT Id, Name, Location FROM TestSchema.Employees;"; $getResults = sqlsrv_query($conn, $tsql); echo("Reading data from table" . PHP_EOL);