SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    167
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    MySQL can't remove actions where friend.id != $uid

    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

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    .... what? What welcome message?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •