Hello everyone,
As I stated on my previous post I stated I'm doing a messaging system and, on this dropdown I want to show sender's name and I need query for that.
I couldn't figure it out.
What I've tried:
and it didn't work.
What shall I do?
Thanks.
As I stated on my previous post I stated I'm doing a messaging system and, on this dropdown I want to show sender's name and I need query for that.
I couldn't figure it out.
What I've tried:
PHP:
<?php
if($message['receiver_id'] == $user['id']) {
// im receiver, show sender's name
$qs = $db->query("SELECT * FROM users WHERE id = '{$messages['receiver_id']}'");
$sender = $db->assoc($qs);
}
echo $sender['username']; ?>
What shall I do?
Thanks.