Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT `timeline`.`action`, `timeline`.`data`, `timeline`.`tlupdate`,
- u1.`id` AS ufrom_id, u1.`username` AS ufrom_username, u1.`firstname` AS ufrom_firstname, u1.`lastname` AS ufrom_lastname, u1.`picture` AS ufrom_picture,
- u2.`id` AS uto_id, u2.`username` AS uto_username, u2.`firstname` AS uto_firstname, u2.`lastname` AS uto_lastname, u2.`picture` AS uto_picture,
- m.`id` AS m_id, m.`name` AS m_name, m.`alternative_name` AS m_altname, m.`tiny_img` AS m_tiny, m.`normal_img` AS m_normal
- FROM `timeline`
- JOIN `users` u1 ON u1.`id` = `timeline`.`user_id_from`
- JOIN `users` u2 ON u2.`id` = `timeline`.`user_id_to`
- JOIN `movies` m ON m.`id` = `timeline`.`movie_id`
- WHERE u1.`id` IN
- (
- SELECT `idol_id`
- FROM `friends`
- WHERE `fan_id` = ?
- )
- OR u2.`id` IN
- (
- SELECT `idol_id`
- FROM `friends`
- WHERE `fan_id` = ?
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement