SELECT * FROM `users`
LEFT join `user_attributes` on user_attributes.user_id = users.id
where
user_attributes.gender = 2
and user_attributes.city = "Витебск"
and user_attributes.age BETWEEN 18 and 25
and not exists (select * from likes where likes.like_user = users.id)
LIMIT 4
approve = 1
<input type="checkbox" name="category[]">
$categories = implode(', ', (array)$_POST['category']); ?>
$categories = json_encode($_POST['category']); ?>
$query = "INSERT INTO `usr`.`rtm` (`lol`) VALUES ('".$a."')";
$ids = [6, 9, 1];
$idsString = implode(',', $ids);
$sql = "SELECT * FROM `cards` WHERE `id_card` IN ($idsString) ORDER BY FIELD (`id_card`, $idsString)";
<input name="data[$id]name"
<input name="name[$id]"