File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
cloud_sql/sqlserver/pdo/src Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public function insertVote(string $value) : bool
109109 $ conn = $ this ->connection ;
110110 $ res = false ;
111111
112- # [START cloud_sql_sqlserver_pdo_connection ]
112+ # [START cloud_sql_server_pdo_connection ]
113113 // Use prepared statements to guard against SQL injection.
114114 $ sql = "INSERT INTO votes (time_cast, vote_value) VALUES (GETDATE(), :voteValue) " ;
115115
@@ -126,7 +126,7 @@ public function insertVote(string $value) : bool
126126 $ e
127127 );
128128 }
129- # [END cloud_sql_sqlserver_pdo_connection ]
129+ # [END cloud_sql_server_pdo_connection ]
130130
131131 return $ res ;
132132 }
Original file line number Diff line number Diff line change 4141 $ hostname = getenv ('DB_HOSTNAME ' ) ?: '127.0.0.1 ' ;
4242
4343 try {
44- // # [START cloud_sql_sqlserver_pdo_create ]
44+ // # [START cloud_sql_server_pdo_create ]
4545 // // $username = 'your_db_user';
4646 // // $password = 'yoursupersecretpassword';
4747 // // $dbName = 'your_db_name';
5050 $ dsn = sprintf ('sqlsrv:server=%s;Database=%s ' , $ hostname , $ dbName );
5151
5252 // Connect to the database.
53- # [START cloud_sql_sqlserver_pdo_timeout ]
53+ # [START cloud_sql_server_pdo_timeout ]
5454 // Here we set the connection timeout to five seconds and ask PDO to
5555 // throw an exception if any errors occur.
5656 $ conn = new PDO ($ dsn , $ username , $ password , [
5757 PDO ::ATTR_TIMEOUT => 5 ,
5858 PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION
5959 ]);
60- # [END cloud_sql_sqlserver_pdo_timeout ]
61- # [END cloud_sql_sqlserver_pdo_create ]
60+ # [END cloud_sql_server_pdo_timeout ]
61+ # [END cloud_sql_server_pdo_create ]
6262 } catch (TypeError $ e ) {
6363 throw new RuntimeException (
6464 sprintf (
You can’t perform that action at this time.
0 commit comments