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
110
110
$ res = false ;
111
111
112
112
# [START cloud_sql_server_pdo_connection]
113
+ # [START cloud_sql_sqlserver_pdo_connection]
113
114
// Use prepared statements to guard against SQL injection.
114
115
$ sql = "INSERT INTO votes (time_cast, vote_value) VALUES (GETDATE(), :voteValue) " ;
115
116
@@ -126,6 +127,7 @@ public function insertVote(string $value): bool
126
127
$ e
127
128
);
128
129
}
130
+ # [END cloud_sql_sqlserver_pdo_connection]
129
131
# [END cloud_sql_server_pdo_connection]
130
132
131
133
return $ res ;
Original file line number Diff line number Diff line change 51
51
52
52
// Connect to the database.
53
53
# [START cloud_sql_server_pdo_timeout]
54
+ # [START cloud_sql_sqlserver_pdo_timeout]
54
55
// Here we set the connection timeout to five seconds and ask PDO to
55
56
// throw an exception if any errors occur.
56
57
$ conn = new PDO ($ dsn , $ username , $ password , [
57
58
PDO ::ATTR_TIMEOUT => 5 ,
58
59
PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION
59
60
]);
61
+ # [END cloud_sql_sqlserver_pdo_timeout]
60
62
# [END cloud_sql_server_pdo_timeout]
61
- # [END cloud_sql_server_pdo_create_tcp ]
63
+ # [END cloud_sql_sqlserver_pdo_create_tcp ]
62
64
} catch (TypeError $ e ) {
63
65
throw new RuntimeException (
64
66
sprintf (
You can’t perform that action at this time.
0 commit comments