File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
cloud_sql/sqlserver/pdo/src Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ public function insertVote(string $value): bool
110110 $ res = false ;
111111
112112 # [START cloud_sql_server_pdo_connection]
113+ # [START cloud_sql_sqlserver_pdo_connection]
113114 // Use prepared statements to guard against SQL injection.
114115 $ sql = "INSERT INTO votes (time_cast, vote_value) VALUES (GETDATE(), :voteValue) " ;
115116
@@ -126,6 +127,7 @@ public function insertVote(string $value): bool
126127 $ e
127128 );
128129 }
130+ # [END cloud_sql_sqlserver_pdo_connection]
129131 # [END cloud_sql_server_pdo_connection]
130132
131133 return $ res ;
Original file line number Diff line number Diff line change 5151
5252 // Connect to the database.
5353 # [START cloud_sql_server_pdo_timeout]
54+ # [START cloud_sql_sqlserver_pdo_timeout]
5455 // Here we set the connection timeout to five seconds and ask PDO to
5556 // throw an exception if any errors occur.
5657 $ conn = new PDO ($ dsn , $ username , $ password , [
5758 PDO ::ATTR_TIMEOUT => 5 ,
5859 PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION
5960 ]);
61+ # [END cloud_sql_sqlserver_pdo_timeout]
6062 # [END cloud_sql_server_pdo_timeout]
61- # [END cloud_sql_server_pdo_create_tcp ]
63+ # [END cloud_sql_sqlserver_pdo_create_tcp ]
6264 } catch (TypeError $ e ) {
6365 throw new RuntimeException (
6466 sprintf (
You can’t perform that action at this time.
0 commit comments