PHP Messages Dropdown

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
Hello everyone, I'm doing some kindof radio panel and I want to add a messaging system to it.
And I want to show last 5 messages in dropdown and if they have is_read = 0 from database it should show a badge above it.
Getting information with ajax, to refresh whenever user clicks refresh button.
Image explaining:
hsr2wUJBSeqCiOd0Cw2rdQ.png


My code is here:

For some reason it does not show anything, any clues why? Thanks in advance.
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Please do not select * from tables. Select only columns you need or null for row exists.

Ur looking for sender Id and receiver Id being the same number
SELECT * FROM messages WHERE receiver_id = '{$user['id']}' AND sender_id = '{$user['id']}'
 

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
Yeah i got that already, point here is it's not showing anything and no preview available on network tab.
Anything seems wrong with my code?
 

Users who are viewing this thread

Top