Jump to content

Remove User Actions When friend.id != $uid


unemployment

Recommended Posts

Here is the scenario….

 

I need to add in….

 

AND user_actions.action_id != 15

AND user_actions.action_id != 24

 

But when I do that it removes my welcome message / or my welcome back message and I need that to only occur for when friend.id != {$uid}

 

SELECT

                users.id,

                users.firstname,

                users.lastname,

                users.username,

                '' AS companyid,

                '' AS industry,

                '' AS stage,

                '' AS companytag,

                friends.gender,

                users.accounttype,

                users.country,

                users.state,

                users.city,

                UNIX_TIMESTAMP(`user_actions`.`time`) AS `approve_date`,

                friends.id AS FeedId,

                friends.firstname AS FeedFirstName,

                friends.lastname AS FeedLastName,

                friends.username AS FeedUserName,

                GROUP_CONCAT(actions.actionsdescription SEPARATOR '~') AS `action_id`,

                GROUP_CONCAT(user_actions.details SEPARATOR '~') AS `details`

            FROM users

            INNER JOIN partners ON partners.user_id = users.id AND partners.approved = 1

            INNER JOIN users friends ON partners.friend_id = friends.id

            INNER JOIN user_actions ON user_actions.user_id = friends.id

            INNER JOIN actions ON user_actions.action_id = actions.id

            WHERE users.id = ${uid}

            AND `user_actions`.`time` < '${time}'

            GROUP BY

                users.id,

                users.firstname,

                users.lastname,

                users.username,

                companyid,

                industry,

                stage,

                companytag,

                friends.gender,

                users.accounttype,

                users.country,

                users.state,

                users.city,

                approve_date,

                FeedId,

                FeedFirstName,

                FeedLastName,

                FeedUserName

 

Link to comment
https://forums.phpfreaks.com/topic/247516-remove-user-actions-when-friendid-uid/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.