Open a TCP connection to Cloud SQL PostgreSQL by using the PHP Data Objects (PDO) extension.
Documentation pages that include this code sample
To view the code sample used in context, see the following documentation:
- Connecting from App Engine flexible environment to Cloud SQL
- Connecting from App Engine standard environment to Cloud SQL
- Connecting from Cloud Functions to Cloud SQL
- Connecting from Cloud Run (fully managed) to Cloud SQL
- Connecting Overview
- Connecting using the Cloud SQL Proxy
- Managing database connections
Code sample
PHP