Skip to content

Commit 33c7a03

Browse files
committed
Add spacing in comments to improve readability
1 parent cc8c554 commit 33c7a03

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

samples/tutorials/php/2.0 PHP Server programming - Stored procedures, Transactions, and UDFs/test.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"Uid" => "yourusername",
66
"PWD" => "yourpassword",
77
];
8-
//Establishes the connection
8+
// Establishes the connection
99
$conn = sqlsrv_connect($serverName, $connectionOptions);
10-
//////////////////STORED PROCEDURE/////////////////////////
10+
////////////////// STORED PROCEDURE /////////////////////////
1111
$tsql = "CREATE PROCEDURE sp_GetCompanies22 AS BEGIN SELECT [CompanyName] FROM SalesLT.Customer END";
1212
$storedProc = sqlsrv_query($conn, $tsql);
1313
if ($storedProc == false) {
@@ -17,9 +17,9 @@
1717
sqlsrv_free_stmt($storedProc);
1818

1919
$tsql = "exec sp_GETCompanies22";
20-
//Executes the query
20+
// Executes the query
2121
$getProducts = sqlsrv_query($conn, $tsql);
22-
//Error handling
22+
// Error handling
2323
if ($getProducts == false) {
2424
echo "Error executing Stored Procedure";
2525
die(FormatErrors(sqlsrv_errors()));
@@ -30,7 +30,7 @@
3030
<h1> First 10 results are after executing the stored procedure: </h1>
3131
<?php
3232
while ($row = sqlsrv_fetch_array($getProducts, SQLSRV_FETCH_ASSOC)) {
33-
//Printing only the first 10 results
33+
// Printing only the first 10 results
3434
if ($ctr > 9) {
3535
break;
3636
}
@@ -50,7 +50,7 @@
5050
sqlsrv_free_stmt($storedProc);
5151
?>
5252
<?php
53-
//////////////////TRANSACTION/////////////////////////
53+
////////////////// TRANSACTION /////////////////////////
5454
if (sqlsrv_begin_transaction($conn) == false) {
5555
echo "Error opening connection";
5656
die(FormatErrors(sqlsrv_errors()));
@@ -85,11 +85,11 @@
8585

8686
?>
8787
<?php
88-
//////////////////UDF/////////////////////////
89-
//Dropping function if it already exists
88+
////////////////// UDF /////////////////////////
89+
// Dropping function if it already exists
9090
$tsql1 = "IF OBJECT_ID(N'dbo.ifGetTotalItems', N'IF') IS NOT NULL DROP FUNCTION dbo.ifGetTotalItems;";
9191
$getProducts = sqlsrv_query($conn, $tsql1);
92-
//Error handling
92+
// Error handling
9393
if ($getProducts == false) {
9494
echo "Error deleting the UDF";
9595
die(FormatErrors(sqlsrv_errors()));
@@ -100,7 +100,7 @@
100100
GROUP BY SalesOrderID
101101
);';
102102
$getProducts = sqlsrv_query($conn, $tsql1);
103-
//Error handling
103+
// Error handling
104104
if ($getProducts == false) {
105105
echo "Error creating the UDF";
106106
die(FormatErrors(sqlsrv_errors()));
@@ -110,7 +110,7 @@
110110
CROSS APPLY dbo.ifGetTotalItems(s.SalesOrderID) f
111111
ORDER BY SalesOrderID;";
112112
$getProducts = sqlsrv_query($conn, $tsql1);
113-
//Error handling
113+
// Error handling
114114
if ($getProducts == false) {
115115
echo "Error executing the UDF";
116116
die(FormatErrors(sqlsrv_errors()));
@@ -124,7 +124,7 @@
124124
echo("<br/>");
125125

126126
while ($row = sqlsrv_fetch_array($getProducts, SQLSRV_FETCH_ASSOC)) {
127-
//Printing only the top 10 results
127+
// Printing only the top 10 results
128128
if ($ctr > 9) {
129129
break;
130130
}

samples/tutorials/php/RHEL/SqlServerColumnstoreSample/columnstore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"Uid" => "sa",
88
"PWD" => "your_password",
99
];
10-
//Establishes the connection
10+
// Establishes the connection
1111
$conn = sqlsrv_connect($serverName, $connectionOptions);
1212

13-
//Read Query
13+
// Read Query
1414
$tsql = "SELECT SUM(Price) as sum FROM Table_with_5M_rows";
1515
$getResults = sqlsrv_query($conn, $tsql);
1616
echo("Sum: ");

samples/tutorials/php/RHEL/SqlServerSample/connect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Uid" => "sa",
66
"PWD" => "your_password",
77
];
8-
//Establishes the connection
8+
// Establishes the connection
99
$conn = sqlsrv_connect($serverName, $connectionOptions);
1010
if ($conn) {
1111
echo "Connected!";

samples/tutorials/php/RHEL/SqlServerSample/crud.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"Uid" => "sa",
66
"PWD" => "your_password",
77
];
8-
//Establishes the connection
8+
// Establishes the connection
99
$conn = sqlsrv_connect($serverName, $connectionOptions);
1010

11-
//Insert Query
11+
// Insert Query
1212
echo("Inserting a new row into table" . PHP_EOL);
1313
$tsql = "INSERT INTO TestSchema.Employees (Name, Location) VALUES (?,?);";
1414
$params = ['Jake', 'United States'];
@@ -21,7 +21,7 @@
2121

2222
sqlsrv_free_stmt($getResults);
2323

24-
//Update Query
24+
// Update Query
2525

2626
$userToUpdate = 'Nikita';
2727
$tsql = "UPDATE TestSchema.Employees SET Location = ? WHERE Name = ?";
@@ -36,7 +36,7 @@
3636
echo($rowsAffected . " row(s) updated: " . PHP_EOL);
3737
sqlsrv_free_stmt($getResults);
3838

39-
//Delte Query
39+
// Delte Query
4040
$userToDelete = 'Jared';
4141
$tsql = "DELETE FROM TestSchema.Employees WHERE Name = ?";
4242
$params = [$userToDelete];
@@ -49,7 +49,7 @@
4949
echo($rowsAffected . " row(s) deleted: " . PHP_EOL);
5050
sqlsrv_free_stmt($getResults);
5151

52-
//Read Query
52+
// Read Query
5353
$tsql = "SELECT Id, Name, Location FROM TestSchema.Employees;";
5454
$getResults = sqlsrv_query($conn, $tsql);
5555
echo("Reading data from table" . PHP_EOL);

samples/tutorials/php/Ubuntu/SqlServerColumnstoreSample/columnstore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"Uid" => "sa",
88
"PWD" => "your_password",
99
];
10-
//Establishes the connection
10+
// Establishes the connection
1111
$conn = sqlsrv_connect($serverName, $connectionOptions);
1212

13-
//Read Query
13+
// Read Query
1414
$tsql = "SELECT SUM(Price) as sum FROM Table_with_5M_rows";
1515
$getResults = sqlsrv_query($conn, $tsql);
1616
echo("Sum: ");

samples/tutorials/php/Ubuntu/SqlServerSample/crud.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"Uid" => "sa",
66
"PWD" => "your_password",
77
];
8-
//Establishes the connection
8+
// Establishes the connection
99
$conn = sqlsrv_connect($serverName, $connectionOptions);
1010

11-
//Insert Query
11+
// Insert Query
1212
echo("Inserting a new row into table" . PHP_EOL);
1313
$tsql = "INSERT INTO TestSchema.Employees (Name, Location) VALUES (?,?);";
1414
$params = ['Jake', 'United States'];
@@ -21,7 +21,7 @@
2121

2222
sqlsrv_free_stmt($getResults);
2323

24-
//Update Query
24+
// Update Query
2525

2626
$userToUpdate = 'Nikita';
2727
$tsql = "UPDATE TestSchema.Employees SET Location = ? WHERE Name = ?";
@@ -36,7 +36,7 @@
3636
echo($rowsAffected . " row(s) updated: " . PHP_EOL);
3737
sqlsrv_free_stmt($getResults);
3838

39-
//Delte Query
39+
// Delte Query
4040
$userToDelete = 'Jared';
4141
$tsql = "DELETE FROM TestSchema.Employees WHERE Name = ?";
4242
$params = [$userToDelete];
@@ -49,7 +49,7 @@
4949
echo($rowsAffected . " row(s) deleted: " . PHP_EOL);
5050
sqlsrv_free_stmt($getResults);
5151

52-
//Read Query
52+
// Read Query
5353
$tsql = "SELECT Id, Name, Location FROM TestSchema.Employees;";
5454
$getResults = sqlsrv_query($conn, $tsql);
5555
echo("Reading data from table" . PHP_EOL);

samples/tutorials/php/Windows/SqlServerColumnstoreSample/columnstore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"Uid" => "sa",
88
"PWD" => "your_password",
99
];
10-
//Establishes the connection
10+
// Establishes the connection
1111
$conn = sqlsrv_connect($serverName, $connectionOptions);
1212

13-
//Read Query
13+
// Read Query
1414
$tsql = "SELECT SUM(Price) as sum FROM Table_with_5M_rows";
1515
$getResults = sqlsrv_query($conn, $tsql);
1616
echo("Sum: ");

samples/tutorials/php/Windows/SqlServerSample/connect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Uid" => "sa",
66
"PWD" => "your_password",
77
];
8-
//Establishes the connection
8+
// Establishes the connection
99
$conn = sqlsrv_connect($serverName, $connectionOptions);
1010
if ($conn) {
1111
echo "Connected!";

samples/tutorials/php/Windows/SqlServerSample/crud.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"Uid" => "sa",
66
"PWD" => "your_password",
77
];
8-
//Establishes the connection
8+
// Establishes the connection
99
$conn = sqlsrv_connect($serverName, $connectionOptions);
1010

11-
//Insert Query
11+
// Insert Query
1212
echo("Inserting a new row into table" . PHP_EOL);
1313
$tsql = "INSERT INTO TestSchema.Employees (Name, Location) VALUES (?,?);";
1414
$params = ['Jake', 'United States'];
@@ -21,7 +21,7 @@
2121

2222
sqlsrv_free_stmt($getResults);
2323

24-
//Update Query
24+
// Update Query
2525

2626
$userToUpdate = 'Nikita';
2727
$tsql = "UPDATE TestSchema.Employees SET Location = ? WHERE Name = ?";
@@ -36,7 +36,7 @@
3636
echo($rowsAffected . " row(s) updated: " . PHP_EOL);
3737
sqlsrv_free_stmt($getResults);
3838

39-
//Delete Query
39+
// Delete Query
4040
$userToDelete = 'Jared';
4141
$tsql = "DELETE FROM TestSchema.Employees WHERE Name = ?";
4242
$params = [$userToDelete];
@@ -49,7 +49,7 @@
4949
echo($rowsAffected . " row(s) deleted: " . PHP_EOL);
5050
sqlsrv_free_stmt($getResults);
5151

52-
//Read Query
52+
// Read Query
5353
$tsql = "SELECT Id, Name, Location FROM TestSchema.Employees;";
5454
$getResults = sqlsrv_query($conn, $tsql);
5555
echo("Reading data from table" . PHP_EOL);

0 commit comments

Comments
 (0)