SELECT cities.arabic_city_name as city_name,pages_categories.cate_parent_category,main_page.category_name_ar as main_page_name ,pages_categories.category_name_ar as category_name, posts.*, users.user_name, users.user_firstname, users.user_lastname, users.user_gender, users.user_picture, users.user_picture_id, users.user_cover, users.user_cover_id, users.user_verified, users.user_subscribed, users.user_pinned_post, pages.*, groups.*, events.* FROM posts LEFT JOIN users ON posts.user_id = users.user_id AND posts.user_type = 'user' LEFT JOIN pages ON posts.page_id = pages.page_id AND posts.user_type = 'page' LEFT JOIN groups ON posts.in_group = '1' AND posts.group_id = groups.group_id LEFT JOIN events ON posts.in_event = '1' AND posts.event_id = events.event_id JOIN pages_categories ON pages.page_category = pages_categories.category_id JOIN pages_categories as main_page ON pages_categories.cate_parent_category = main_page.category_id JOIN cities ON posts.city_id = WHERE NOT (users.user_name <=> NULL AND pages.page_name <=> NULL) AND posts.post_id= '106541' AND deleted_at IS NULL سيارات-للايجار-#