[PEAR][DB] Problème avec include DB.php
Alors voila mon constructeur marche en local mais pas sur le serveur
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
var $db;
var $tablePrefix;
var $userTablePrefix;
function phpList($pathToPhpList=NULL) {
// if no path specified, assume this file is in thephplist dir
if (empty($pathToPhpList)) $pathToPhpList = dirname(__FILE__);
// Include your phpList config.php file here
require("$pathToPhpList/config/config.php");
$this->tablePrefix = $table_prefix;
$this->userTablePrefix = $usertable_prefix;
// Setup and connect to the database (this only needs to be done once per session
// You don't need to change anything here.
include_once("DB.php");
$this->db = DB::connect("mysql://$database_user:$database_password@$database_host/$database_name");
if (DB::isError($this->db)) die($this->db->getMessage());
$this->db->setFetchMode(DB_FETCHMODE_ASSOC);
} |
Pour debuguer j'ai rajouté des echo :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
var $db;
var $tablePrefix;
var $userTablePrefix;
function phpList($pathToPhpList=NULL) {
// if no path specified, assume this file is in thephplist dir
if (empty($pathToPhpList)) $pathToPhpList = dirname(__FILE__);
echo 'debut<br>';
// Include your phpList config.php file here
require("$pathToPhpList/config/config.php");
$this->tablePrefix = $table_prefix;
$this->userTablePrefix = $usertable_prefix;
echo 'suite<br>';
// Setup and connect to the database (this only needs to be done once per session
// You don't need to change anything here.
include_once("DB.php");
echo 'include<br>';
$this->db = DB::connect("mysql://$database_user:$database_password@$database_host/$database_name");
echo 'connecte<br>';
if (DB::isError($this->db)) die($this->db->getMessage());
$this->db->setFetchMode(DB_FETCHMODE_ASSOC);
echo 'fin';
} |
ca affiche jusqu'au include et puis aprés plus rien. Si l'erreur venai de la connexion ca me ferait quand meme les echo (et puis ca me ferai le message d'erreur aussi^^). Donc je pense que c'est peut etre un probleme de syntaxe dans la fonction connect (si c'est ca ca n'aurai pas du marcher en local) sinon ca vient du serveur?