/** * __construct * * Class constructor * */ public function __construct() { self::$Instance = $this; }
<?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/>";
<?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/>";
<?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');
<?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/>";
<?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/>";
<?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/>";