$results = $wpdb->get_results("SELECT COUNT(user_id) as count
FROM `wp_konkurs`
WHERE ( `user_email` = 'mail@mail.ru' ) AND ( DATE(user_time) = ' $nowDate ' ) ;
");
$result[0]->count
$your_friends = [12, 333, 7654, 987, 3456, 962, 150]; // твои друзья
$friends_your_friend = [1444, 973, 54, 987, 3456, 92, 4900]; // чужие друзья
$mutual_friends = array_intersect($your_friends, $friends_your_friend); // [ 987, 3456]
$sql = 'select * from `friends` where id_user in('.implode(',',$mutual_friends).')';
DROP TABLE IF EXISTS `t_content`;
CREATE TABLE `t_content` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` enum('blog','news','page') DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`title` varchar(555) DEFAULT NULL,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `t_content` WRITE;
/*!40000 ALTER TABLE `t_content` DISABLE KEYS */;
INSERT INTO `t_content` (`id`, `type`, `alias`, `title`, `content`)
VALUES
(1,'blog','eto_statia_bloga','Это статья блога','Контент'),
(2,'news','eto_novost','Это новость','Текст новости'),
(3,'page','kontacty','Контакты','Обычная страница, например с контактами');
/*!40000 ALTER TABLE `t_content` ENABLE KEYS */;
UNLOCK TABLES;
INSERT INTO `news` (title,content,category,date, res_name, res_link) VALUES ('', '$this->title', '$this->content','$this->category', '$this->date', '$this->res_name', '$this->res_link')