Notifications for new comments
I am currently working on a comment system which I have integrated in chevereto here a video example of my project
How can I show my comments new comments in notifications? until now it has only managed an empty window in notifications. My table structure in comments:

In Notifications table i am added notification_type comment
In class.notification
i am added
And I have an error message when clicking on notifications. Where is my mistake?
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON notification_type = "comment" AND notification_type_id = id\n\t\t\t\tLEFT JOIN chv' at line 4\n'
I am currently working on a comment system which I have integrated in chevereto here a video example of my project
How can I show my comments new comments in notifications? until now it has only managed an empty window in notifications. My table structure in comments:

In Notifications table i am added notification_type comment
In class.notification
Code:
$db->query('SELECT * FROM '.$tables['notifications'].'
LEFT JOIN '.$tables['likes'].' ON notification_type = "like" AND notification_type_id = like_id AND notification_type_id > 0
LEFT JOIN '.$tables['follows'].' ON notification_type = "follow" AND notification_type_id = follow_id
LEFT JOIN '.$tables['images'].' ON notification_content_type = "image" AND like_content_type = "image" AND like_content_id = image_id
LEFT JOIN '.$tables['albums'].' ON notification_content_type = "album" AND like_content_type = "album" AND like_content_id = album_id
LEFT JOIN '.$tables['users'].' ON user_id = (
CASE notification_type
WHEN "like" THEN like_user_id
WHEN "comment" THEN user_id
WHEN "follow" THEN follow_user_id
ELSE NULL
END
)
i am added
Code:
LEFT JOIN '.$tables['comments'].' ON notification_type = "comment" AND notification_type_id = id
And I have an error message when clicking on notifications. Where is my mistake?
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON notification_type = "comment" AND notification_type_id = id\n\t\t\t\tLEFT JOIN chv' at line 4\n'
Last edited: