File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 62
62
}
63
63
64
64
// Connect to the database.
65
+ # [START cloud_sql_mysql_pdo_timeout]
65
66
// Here we set the connection timeout to five seconds and ask PDO to
66
67
// throw an exception if any errors occur.
67
68
$ conn = new PDO ($ dsn , $ username , $ password , [
68
69
PDO ::ATTR_TIMEOUT => 5 ,
69
70
PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION
70
71
]);
72
+ # [END cloud_sql_mysql_pdo_timeout]
71
73
# [END cloud_sql_mysql_pdo_create]
72
74
} catch (TypeError $ e ) {
73
75
throw new RuntimeException (
Original file line number Diff line number Diff line change 50
50
$ dsn = sprintf ('sqlsrv:server=%s;Database=%s ' , $ hostname , $ dbName );
51
51
52
52
// Connect to the database.
53
+ # [START cloud_sql_sqlserver_pdo_timeout]
53
54
// Here we set the connection timeout to five seconds and ask PDO to
54
55
// throw an exception if any errors occur.
55
56
$ conn = new PDO ($ dsn , $ username , $ password , [
56
57
PDO ::ATTR_TIMEOUT => 5 ,
57
58
PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION
58
59
]);
60
+ # [END cloud_sql_sqlserver_pdo_timeout]
59
61
# [END cloud_sql_sqlserver_pdo_create]
60
62
} catch (TypeError $ e ) {
61
63
throw new RuntimeException (
You can’t perform that action at this time.
0 commit comments