2
I found a project made in PHP OO to be used in Postgresql with this connection.
<?php
class BD {
public function __construct() {
pg_connect("host=localhost port=5432 user=usuario password=senha dbname=nome_do_BD")
or die("Erro ao conectar ao servidor");
}
public function __destruct() {
//pg_close();
}
}
?>
Is there any way I can change this file to access the BD in phpMyAdmin?
I’m using the Wampserver.
I tried that, but to no avail:
<?php
class BD {
public function __construct() {
pg_connect("host='localhost' user='root' password='' dbname='nome_do_BD'")
or die("Erro ao conectar ao servidor");
}
public function __destruct() {
//pg_close();
}
}
?>
This link: [TUTORIAL] Connect PHP site to MYSQL database teaches how to make a connection to mysql! - Feather Painted now edit
– Pena Pintada
Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?
– Maniero