mardi 6 janvier 2015

is_file keeps returning false

I'm trying to connect to database but when it's trying to check the file, it keeps returning error.



<?php

class Database
{
private $host;
private $user;
private $password;
private $database;

function __construct($filename){

if(is_file($filename)) include '../include/connect.php';
else throw new exception("Error!"); //<--- keeps returning "Error!"

$this->host=$host;
$this->user=$user;
$this->password=$password;
$this->database=$database;
}


Here is my connect.php:



<?php
$host = "localhost";
$user = "root";
$password= "";
$database= "audiologiska_kliniken";

Aucun commentaire:

Enregistrer un commentaire