php - I am selecting a friend list using following query but it will also showing the user himself in list. I will pass id of user in $userid -
(select `wp_users`.`id` , 'friend' type, concat(`wp_users`.`display_name`,' ',`wp_users`.`last_name`) title, concat('https://eduncle-courses-cdn.saglus.com/library/',`wp_users`.`id` ,'/profile_pic/thumbnail/',`wp_users`.`user_img`) image, `entrv_master_users_chat`.`type`, `entrv_master_users_chat`.`message`, `entrv_master_users_chat`.`type` msg_type, `entrv_master_users_chat`.`created` msg_send, `wp_users`.`display_name` sender_name, (select count(id) `entrv_master_users_chat` `sender_id` = `wp_users`.`id` , `read` =0 , `receiver_id` = '$userid') unread_msg `entrv_master_users_chat` left join `wp_users` on `wp_users`.`id` = `entrv_master_users_chat`.`sender_id` `entrv_master_users_chat`.`receiver_id`='$userid' group `entrv_master_users_chat`.`sender_id` )order type desc
Comments
Post a Comment