Ich komme einfach nicht weiter?
Bekomme jedes mal die meldung ''Uncaught Error: Failed opening required 'C:\xampp\htdocs\shop1function/database.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\shop1\index.php on line 6..''
obwohl alles in ordnugn sein musste konnt ihr mir helfen
PHP
- C:\xampp\htdocs\shop1\index.php
- <?php
- error_reporting(-1);
- ini_set('display_errors','On');
- define('CONFIG_DIR',__DIR__.'/config');
- require_once __DIR__.'function/database.php';
- $sql ="SELECT id,titel,discription,price FROM products";
- $result = getDB()->query($sql);
- require __DIR__.'/templates/main.php';
der ordner ist auch zu hundert prozent richtig angeleget
PHP
- C:\xampp\htdocs\shop1\function\datapase.php
- <?php
- function getDB(){
- static $db;
- if($db instanceof PDO){
- return $db;
- }
- require_once CONFIG_DIR.'/database.php';
- $dsn = sprintf("mysql:host=%s;dbname%s,charset=%s",DB_HOST,DB_DATABASE,DB_CHARSET,);
- $db = new POD($dsn,DB_USERNAME,DB_PASSWORD);
- return $db;
- }