Jump to content

Wrong echo or wrong query?


unemployment

Recommended Posts

I am querying...

 

$sql  = "SELECT `messages_inbox`.`message_id`, `users`.`firstname`, `users`.`lastname`, `users`.`username` AS `from`, '${user_info['username']}' AS `to`, `subject`, LENGTH(`files`) AS `len`, 'inbox' AS `box`, DATE_FORMAT(`messages_inbox`.`time` ,'%T %D-%M-%Y') AS `time` ";

 

$sql .= "FROM `messages_inbox` INNER JOIN `users` ON `messages_inbox`.`from_id` = `users`.`id` WHERE `to_id` = ${user_info['uid']} AND `messages_inbox`.`deleted` = 0 ORDER BY `messages_inbox`.`message_id` DESC";

 

and I am trying to output

 

$displayName = ucwords("${message['firstname']} ${message['lastname']}");

 

by using

 

$messages = pm_fetch_all($_GET['box']);

 

I know my fetch works but for some reason firstname and lastname are only returning the logged in users first name and last name, not the person who sent the message.

Link to comment
https://forums.phpfreaks.com/topic/225788-wrong-echo-or-wrong-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.