Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
class db {
private static $instance = null;
private function __construct() {
}
public static function Connect() {
if (self::$instance == null) {
try {
$Connect = Configure::Read('connect');
self::$instance = new PDO
(
"mysql:host=" . $Connect['host']
. ";dbname=" . $Connect['dataBase'],
$Connect['user'],
$Connect['password'],
array(
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES " . $Connect['charset'],
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
)
);
} catch (PDOException $e) {
//echo $e->getMessage();
//throw new DatabaseExceptions('Incorrect given database information');
}
}
return self::$instance;
}
private function __clone() {
}
}
$con = db::Connect();
$srok = 0;
$sql = "SELECT * FROM `banlist` WHERE `kraen_srok` != :srok";
$query = $con->prepare($sql);
$query->bindParam(':srok', $srok, PDO::PARAM_INT);
$query->execute();
$con = db::Connect();
$sql = "SELECT * FROM `banlist` WHERE `kraen_srok` != 0";
$query = $con->prepare($sql);
$query->execute();