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 6262 }
6363
6464 // Connect to the database.
65+ # [START cloud_sql_mysql_pdo_timeout]
6566 // Here we set the connection timeout to five seconds and ask PDO to
6667 // throw an exception if any errors occur.
6768 $ conn = new PDO ($ dsn , $ username , $ password , [
6869 PDO ::ATTR_TIMEOUT => 5 ,
6970 PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION
7071 ]);
72+ # [END cloud_sql_mysql_pdo_timeout]
7173 # [END cloud_sql_mysql_pdo_create]
7274 } catch (TypeError $ e ) {
7375 throw new RuntimeException (
Original file line number Diff line number Diff line change 5050 $ dsn = sprintf ('sqlsrv:server=%s;Database=%s ' , $ hostname , $ dbName );
5151
5252 // Connect to the database.
53+ # [START cloud_sql_sqlserver_pdo_timeout]
5354 // Here we set the connection timeout to five seconds and ask PDO to
5455 // throw an exception if any errors occur.
5556 $ conn = new PDO ($ dsn , $ username , $ password , [
5657 PDO ::ATTR_TIMEOUT => 5 ,
5758 PDO ::ATTR_ERRMODE => PDO ::ERRMODE_EXCEPTION
5859 ]);
60+ # [END cloud_sql_sqlserver_pdo_timeout]
5961 # [END cloud_sql_sqlserver_pdo_create]
6062 } catch (TypeError $ e ) {
6163 throw new RuntimeException (
You can’t perform that action at this time.
0 commit comments