I would like to put a com in a SQL query for example:
wp_usermeta.meta_key = 'first_name' or wp_usermeta.meta_key ='last_name'
Would you like to put red here 'last_name'
is it possible?
Follow the complete query code:
$sql = ("select DISTINCT ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, (select REPLACE(Group_concat(wp_usermeta.meta_value),',',' ') as full_name from wp_users left join wp_usermeta on wp_users.ID = wp_usermeta.user_id where (wp_usermeta.meta_key = 'first_name' or wp_usermeta.meta_key ='last_name') and wp_users.ID = userid) username, ".TABLE_PREFIX.DB_USERTABLE.".user_nicename link, wp_usermeta.meta_value avatar, cometchat_status.lastactivity lastactivity, cometchat_status.status, cometchat_status.message, cometchat_status.isdevice from ".TABLE_PREFIX.DB_USERTABLE." left join wp_usermeta on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = wp_usermeta.user_id left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid ".$offlinecondition." and (wp_usermeta.meta_key = 'user_avatar' ) order by username asc");