well the title says enough I guess! my db connection always fails for the verification for some reason...
<?php
//main.php\\
require('database_pdo.php');
$con = new Database($dbhost,$dbusername,$dbpassword,$dbname);
if($con){
header("Refresh: 5; url=index.php");
$message = '<font color="LIME"><center>The page will refresh within 5 seconds to the next step!<br /><img src="./theme/main/CountDown.gif"/></center></font>';
}else{
$message = '<font color="RED"><center>Database connection failed!<br />Please try again and/or check your connection info!<br />Error Given:<br />'.$dberror.'</center></font>';
}
//database_pdo.php\\
class Database extends PDO
{
private $db;
public function Database($host, $user, $pass, $db) {
try {
$this->db = new PDO("mysql:dbname=".$db.";host=".$host.";", $user, $pass);
} catch(PDOEXCEPTION $e) {
$dberror = 'An error has occurred! [Code: '.$e->getCode().']!<br/>More info: ['.$e->getMessage().']!';
}
}
public function runQuery($query) {
try{
return $this->db->query($query);
} catch(PDOEXCEPTION $e) {
$dberror = 'An error has occurred! [Code: '.$e->getCode().']!<br/>More info: ['.$e->getMessage().']!';
}
}
}
?>
can anybody help me it would be apperciated! it's a really annoying error so it must be fixd as soon as possible I asked it in the chat but neither one knew so this might help me better