SELECT `e1`.`user2` FROM `event` AS `e1`
INNER JOIN `event` AS `e2` ON `e1`.`user2` = `e2`.`user1`
WHERE `e1`.`user1` = $user AND `e2`.`user2` = $user
SELECT `e1`.`user1`, `e1`.`user2` FROM `event` AS `e1`
INNER JOIN `event` AS `e2` ON `e1`.`user2` = `e2`.`user1` AND `e1`.`user1` = `e2`.`user2`
WHERE `e1`.`user1` < `e1`.`user2`
$sql = "UPDATE indexing_link SET title='".$title."', short='".$short ."' WHERE id=".$id_current_url;
print $sql;
mysqli_query($mysqli, $sql) or die('Error_ ('.mysqli_errno($mysqli).') '.mysqli_error($mysqli));
SELECT DISTINCT `res`.`id_page` FROM `fields_value` AS `res`
INNER JOIN `fields_value` AS `f1` ON (`f1`.`id_page` = `res`.`id_page` AND `f1`.`id_field` = 22 AND `f1`.`value` = 'Платный')
INNER JOIN `fields_value` AS `f2` ON (`f2`.`id_page` = `res`.`id_page` AND `f2`.`id_field` = 11 AND `f2`.`value` = '100')
INNER JOIN `fields_value` AS `f3` ON (`f3`.`id_page` = `res`.`id_page` AND `f3`.`id_field` = 33 AND `f3`.`value` = 'есть')
SELECT `id_услуги`, COUNT(`id услуги`)
FROM `услуги`
WHERE `id_отеля` IN (список отелей)
GROUP BY `id_услуги`
SELECT `услуги`.`id_услуги`, COUNT(`услуги`.`id услуги`)
FROM `услуги`
RIGHT JOIN `отели` ON `отели`.`id_отеля` = `услуги`.`id_отеля`
WHERE условия выбора отеля
GROUP BY `услуги`.`id_услуги`