Beispiel #1
0
 /**
  *  __construct
  *  
  * Class constructor
  *
  */
 public function __construct()
 {
     self::$Instance = $this;
 }
Beispiel #2
0
<?php

$mysqli = @new mysqli('localhost', 'admin', 'pass', 'dbtest');
require "../../library/dhtmlsql.php";
$db = DHTMLSQL::connect($mysqli);
if (!$db->connected()) {
    exit("Unable to connect to database");
}
//Sets MySQL character set and collation
$db->set_charset('utf8', 'utf8_general_ci');
echo "Database connection was successful<br/><br/>";
Beispiel #3
0
<?php

$mysqli = @new mysqli('localhost', 'admin', 'pass', 'dbtest');
require "../../library/dhtmlsql.php";
$db = DHTMLSQL::get()->connect($mysqli);
if (!$db->connected()) {
    exit("Unable to connect to database");
}
//Sets MySQL character set and collation
$db->set_charset('utf8', 'utf8_general_ci');
echo "Database connection was successful<br/><br/>";
Beispiel #4
0
<?php

/*
This is a basic database connection script using DHTMLSQL
*/
require "library/dhtmlsql.php";
$dhtmlsql = new DHTMLSQL();
$db = $dhtmlsql->connect('localhost', 'admin', 'pass', 'dbtest');
// Connection data (server_address, database, name, poassword)
$db = DHTMLSQL::connect('localhost', 'admin', 'pass', 'dbtest');
//confirm database connection
if (!$db->connected()) {
    exit("Unable to connect to database. Reason: " . $db->connect_error());
}
//Sets MySQL character set and collation
$db->set_charset('utf8', 'utf8_general_ci');
Beispiel #5
0
<?php

require "../../library/dhtmlsql.php";
// Connection data (server_address, database, name, poassword)
$dbhost = 'localhost';
$dbname = 'dbtest';
$dbuser = '******';
$dbpass = '******';
$db = new DHTMLSQL();
//attempt connection to database
$db->connect($dbhost, $dbuser, $dbpass, $dbname);
//testing for connection to database
if (!$db->connected()) {
    exit("Unable to connect to database");
}
//Sets MySQL character set and collation
$db->set_charset('utf8', 'utf8_general_ci');
echo "Database connection was successful<br/><br/>";
Beispiel #6
0
<?php

require "../../library/dhtmlsql.php";
// Connection data (server_address, database, name, poassword)
$dbhost = 'localhost';
$dbname = 'dbtest';
$dbuser = '******';
$dbpass = '******';
//attempt connection to database
$db = DHTMLSQL::load()->connect($dbhost, $dbuser, $dbpass, $dbname);
//testing for connection to database
if (!$db->connected()) {
    exit("Unable to connect to database");
}
//Sets MySQL character set and collation
$db->set_charset('utf8', 'utf8_general_ci');
echo "Database connection was successful<br/><br/>";
Beispiel #7
0
<?php

require "../../library/dhtmlsql.php";
// Connection data (server_address, database, name, poassword)
$dbhost = 'localhost';
$dbname = 'dbtest';
$dbuser = '******';
$dbpass = '******';
//attempt connection to database
new DHTMLSQL();
$db = DHTMLSQL::connect($dbhost, $dbuser, $dbpass, $dbname);
//testing for connection to database
if (!$db->connected()) {
    exit("Unable to connect to database");
}
//Sets MySQL character set and collation
$db->set_charset('utf8', 'utf8_general_ci');
echo "Database connection was successful<br/><br/>";