Ejemplo n.º 1
0
 public function __construct()
 {
     DBParameters::construct();
     parent::__construct('mysql:host=' . DBParameters::Hostname() . ';dbname=' . DBParameters::DBname(), DBParameters::Username(), DBParameters::Password(), array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
     // parent::setFetchMode(PDO::FETCH_OBJ);
     $this->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
 }
Ejemplo n.º 2
0
 function Database()
 {
     // Method : begin
     //Konstruktor
     // ********** DIESE WERTE ANPASSEN **************
     // ********** ADJUST THESE VALUES HERE **********
     $this->host;
     //          <<---------
     $this->password;
     //          <<---------
     $this->user;
     //          <<---------
     $this->database;
     $this->rows;
     // $this->host = "localhost";
     // $this->password = "";
     // $this->user = "******";
     // $this->database = "pnufarm_productosnufarm";
     // $this->rows = 0;
     // **********************************************
     // **********************************************
     DBParameters::construct();
     $this->host = DBParameters::Hostname();
     //          <<---------
     $this->password = DBParameters::Password();
     //          <<---------
     $this->user = DBParameters::username();
     //          <<---------
     $this->database = DBParameters::Dbname();
     $this->rows = 0;
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     DBParameters::construct();
     $this->host = DBParameters::Hostname();
     $this->dbname = DBParameters::Dbname();
     $this->dbuser = DBParameters::Username();
     $this->dbpass = DBParameters::Password();
     parent::__construct('mysql:host=' . $this->host . ';dbname=' . $this->dbname, $this->dbuser, $this->dbpass);
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     DBParameters::construct();
     // parent::__construct();
     parent::__construct('mysql:host=' . DBParameters::Hostname() . ';dbname=' . DBParameters::DBname(), DBParameters::Username(), DBParameters::Password());
 }
Ejemplo n.º 5
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
require_once realpath(__DIR__ . '/..') . '/core/pdo/debug.db.php';
use Debug\DBParameters;
if ($_SERVER['HTTP_HOST'] == "localhost") {
    define('LOGIN_NUFARM', 'http://localhost/ftp/loginNufarm');
} else {
    define('LOGIN_NUFARM', "http://" . $_SERVER['HTTP_HOST']);
}
DBParameters::construct();
// NUFARM MAX
$hostname_conexion = DBParameters::Hostname();
$database_conexion = DBParameters::Dbname();
$username_conexion = DBParameters::Username();
$password_conexion = DBParameters::Password();
$conexion = mysql_connect($hostname_conexion, $username_conexion, $password_conexion) or trigger_error(mysql_error(), E_USER_ERROR);
mysql_query("SET NAMES 'utf8'", $conexion);
if (is_file("includes/funciones.php")) {
    include "includes/funciones.php";
} else {
    include "../includes/funciones.php";
}
Ejemplo n.º 6
0
 public function __construct()
 {
     DBParameters::construct();
     $this->db = new PDO('mysql:host=' . DBParameters::Hostname() . ';dbname=' . DBParameters::Dbname(), DBParameters::Username(), DBParameters::Password());
 }