commit a362e27ff9e768135f386fef441a2fd769792d21
parent d2aae646eb6625314a8be9508c348e0ec06ce6aa
Author: MTRNord <mtrnord1@gmail.com>
Date: Tue, 17 Mar 2015 18:03:56 +0100
same error here
Diffstat:
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/core/api/v1/DbConnect.class.php b/core/api/v1/DbConnect.class.php
@@ -19,31 +19,32 @@ if ($root_3[1] == 'core') {
* @author Ravi Tamada
*/
class DbConnect {
-
+
private $conn;
-
- function __construct() {
+
+ function __construct() {
}
-
+
/**
* Establishing database connection
* @return database connection handler
*/
function connect() {
+ global $root;
include_once $root . '/core/config/api.php';
-
+
// Connecting to mysql database
$this->conn = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME);
-
+
// Check for database connection error
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
-
+
// returing connection resource
return $this->conn;
}
-
+
}
-
-?>
-\ No newline at end of file
+
+?>