Skip to content

Instantly share code, notes, and snippets.

@Tynael
Last active October 9, 2023 19:51
Show Gist options
  • Save Tynael/a27205c26ed3edb033ac8ea6aeb6e8f0 to your computer and use it in GitHub Desktop.
Save Tynael/a27205c26ed3edb033ac8ea6aeb6e8f0 to your computer and use it in GitHub Desktop.
Test PostgreSQL default connection with PHP
<?php
var_dump(
pg_connect("
host=localhost
port=5432
dbname=postgres
user=postgres
password=root
")
);
// Returns the PgSQL\Connection object if the connection is successful.
// Otherwise, returns false
?>
@Tynael
Copy link
Author

Tynael commented Oct 9, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment