public function __construct(Array $a) {
$this->title = $a['title'];
$this->content = $a['content'];
$this->category = $a['category'];
$this->res_link = $a['resource_link'];
$this->res_name = $a['resource_name'];
$this->date = ('Y-m-d');
$this->try_connect = self::obj()->connect();
}
public function __construct(Array $a) {
$this->title = 'ебаный';
$this->content = 'скрипт';
$this->category = 'который';
$this->res_link = 'нихуя';
$this->res_name = 'не работает';
$this->date = ('Y-m-d');
$this->try_connect = self::obj()->connect();
}
//Сам пароль
$password = 'kernel_panic_is_not_1337';
//Хешируем первоначальный пароль
$hash1 = sha1($password);
//Генерируем случайный набор символов (соль)
$salt = 'salt_string_can_be_strong_and_hard_as_steel';
//Складываем старый хеш с солью и пропускаем через функцию sha1()
$hash2 = sha1($hash1 . $salt);
//Сравниваем полученный хэш с хранимым хэшем
if (hash2 == hash_from_db) {
echo ('success');
} else { echo ('fail');}
SELECT `p`.`thread_id`
FROM `msg_participants` AS `p`
JOIN `msg_participants` AS `t` USING(`thread_id`)
WHERE `p`.`user_id` = ?
AND `t`.`user_id` = ?
SELECT `p`.`thread_id`
FROM (SELECT `thread_id` FROM `msg_participants` WHERE `user_id` = ?)
AS `p`
JOIN (SELECT `thread_id` FROM `msg_participants` WHERE `user_id` = ?)
AS `t` USING(`thread_id`)