For those looking for examples:
$connection = new PDO(
'pgsql:dbname=<db_name>;host=<redshift_cluster_host>;port=5439',
'<master_user_name>',
'<master_user_password>'
);
$statement = $connection->prepare('<your_query>');
$statement->execute();
$result = $statement->fetch();
Also, make sure that you correctly configured the cluster security groups (on the Security tab in the AWS Redshift administrator).
source
share