page:
Code: Select all
require_once($phpbb_root_path . 'PDOconexion.' . $phpEx);
$db = new Connect();
$result = $db->query("SELECT d.name FROM Table d") or die("Error.");
Code: Select all
<?php
class Connect extends PDO {
private $type = 'mysqli';
private $host = 'mysql.hostinger.com';
private $db_name = '';
private $user = '';
private $pass = '';
public function __construct() {
try{
parent::__construct($this->type.':host='.$this->host.'; dbname='.$this->db_name, $this->user, $this->pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
}catch(PDOException $e){
echo 'Error. DDetails: ' . $e->getMessage();
exit;
}
}
}
?>
I tryed thsi code the code of this page and nothing too: viewtopic.php?f=71&t=2226541