Jump to content

Anthing wrong with this query?


unemployment

Recommended Posts

My variable `users`.`id` isn't being passed through correctly.

 

$ms = 'SELECT `messages_inbox`.`from_id`, `messages_inbox`.`subject`, `messages_inbox`.`body`, `messages_inbox`.`files`, `messages_inbox`.`inbox` AS `box`';
$ms.= 'SELECT LEFT `users`.`firstname`, `users`.`lastname`';
$ms.= 'SELECT FROM `messages_inbox` INNER JOIN `users` ON `messages_inbox`.`from_id` = `users`.`id`' or die(mysql(error)); 

 

Link to comment
https://forums.phpfreaks.com/topic/225685-anthing-wrong-with-this-query/
Share on other sites

the only variable in that code appears to be $ms. what exactly are you trying to do?

 

I am trying to adjust the query below to also select user data from the users table.  This is why I am also using a JOIN.

$msgs = mysql_query("SELECT `from_id`, `subject`, `body`, `files`, 'inbox' AS `box` FROM `messages_inbox` WHERE `message_id` = ${id}");

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.