Skip to content

Commit dba232a

Browse files
committed
address review comment
1 parent 390be3d commit dba232a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cloud_sql/sqlserver/pdo/app.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env_variables:
2121
DB_USER: my-db-user
2222
DB_PASS: my-db-pass
2323
DB_NAME: my_db
24+
DB_HOSTNAME: localhost
2425

2526
# Defaults to "serve index.php" and "serve public/index.php". Can be used to
2627
# serve a custom PHP front controller (e.g. "serve backend/index.php") or to

cloud_sql/sqlserver/pdo/src/DB.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public static function createPdoConnection()
3232
// $username = 'your_db_user';
3333
// $password = 'yoursupersecretpassword';
3434
// $schema = 'your_db_name';
35+
// $hostname = 'your_hostname';
3536

36-
$dsn = sprintf('sqlsrv:server=(local);Database=%s', $schema, $hostname);
37+
$dsn = sprintf('sqlsrv:server=%s;Database=%s', $hostname, $schema);
3738

3839
return new PDO($dsn, $username, $password);
3940
# [END cloud_sql_sqlserver_pdo_create]

0 commit comments

Comments
 (0)