Connect PHP with MS-Access

1

I'm trying to connect my Access database with PHP, but it's not finding the way. I did not want to put the path relative to the HD because I host my page on a host (it uses Linux) and so I wanted to put the path relative to the page itself.

My code looks like this:

// Add arquivo e a extensão 
$database_name = $_SERVER["DOCUMENT_ROOT"] . "_assets\db.accdb"; 
// Verifica se o arquivo existe.
if (!file_exists($database_name )) {
    die("Não foi possível encontrar o arquivo.");
}
    
asked by anonymous 09.05.2018 / 13:49

1 answer

0

Go a slash between $_SERVER and file:

$_SERVER["DOCUMENT_ROOT"] . "\_assets\db.accdb"; 
    
09.05.2018 / 13:51