The problem is that I like to use the MDB2 or DB module of PEAR. But when I'm trying to connect he gives me all the time a 'not found'-error.
This is my code:
- Code: Select all
<?php
$db_type='mysql';
$db_host='localhost';
$db_database='allesinhout';
$db_username='root';
$db_password='*****';
$dsn="$db_type://$db_username:$db_password@$db_host/$db_database";
require_once("../../php/pear/MDB2.php");
$connection =& MDB2::connect($dsn, array());
if (MDB2::isError($connection)){
die("Could not connect to the database: <br />".MDB2::errorMessage($connection));
}
?>
The problem has to be with the path. My localhost is at C:\Program Files\xampp\htdocs\ and i'm calling this file from http:\\localhost\allesinhout\index.php
The database itself is not in at C:\Program Files\xampp\htdocs\ but somewhere in C:\Program Files\xampp\mysql\ I think. Could this be the problem, and if it is, how can I solve it.
Thanks in advance
[/code]