Web Development

ADODb Connection to a Different Schema in PostgreSQL

Logo PostgreSQL

In the past, I just create a new database to every apps I made.┬áRecently, I try to connect to a PostgreSQL using a different schema in one database. Using ADODb, it’s relatively easy to connect:

try {
    $DB->Connect("host=localhost port=5432 dbname=my_db user=my_user password=my_secret options=--search_path=my_schema);
} catch (exception $e) {
    //var_dump($e);
    echo 'Cannot connect';
}

Leave a Reply

Theme by Anders Norén