php - Conditional Join Statement in MySQL using IF-ELSE -
i'm making notification scheme social networking app. i've different kind of notification categorized in 2 groups: friends-related , events-related. currently, database schema this: +---------------------+------------------------+------+-----+---------+----------------+ | field | type | null | key | default | | +---------------------+------------------------+------+-----+---------+----------------+ | notification_id | int(11) | no | pri | null | auto_increment | | notification_type | enum('event','friend') | no | | null | | | notification_date | datetime | no | | null | | | notification_viewed | bit(1) | no | | null | | | user_id | int(11) | no | mul | null | | +---------------------+------------------------+------+-----+---------+-----------...