-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfo.php
More file actions
34 lines (30 loc) · 1.06 KB
/
info.php
File metadata and controls
34 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
define('BOT_TOKEN', '262354959:AAGZbji0qOxQV-MwzzRqiWJYdPVzkqrbC4Y');
define('API_URL', 'https://api.telegram.org/bot' . BOT_TOKEN . '/');
class Database {
private static $dbName = 'u188732877_loot';
private static $dbHost = 'mysql.hostinger.it' ;
private static $dbUsername = 'u188732877_admin';
private static $dbUserPassword = 'bSi9vOB5UrCH';
private static $connected = null;
// costruttore della classe
public function __construct() {
die('Init function is not allowed');
}
// connesione al database
public static function connect() {
// soltanto una connesione è consentita
if(null == self::$connected) {
try {
self::$connected = new PDO( "mysql:host=".self::$dbHost.";"."dbname=".self::$dbName, self::$dbUsername, self::$dbUserPassword);
} catch(PDOException $e) {
die($e->getMessage());
}
}
return self::$connected;
}
// disconnessione dal database
public static function disconnect() {
self::$connected = null;
}
}