unemployment Posted January 26, 2011 Share Posted January 26, 2011 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 More sharing options...
BlueSkyIS Posted January 26, 2011 Share Posted January 26, 2011 the only variable in that code appears to be $ms. what exactly are you trying to do? Link to comment https://forums.phpfreaks.com/topic/225685-anthing-wrong-with-this-query/#findComment-1165314 Share on other sites More sharing options...
unemployment Posted January 26, 2011 Author Share Posted January 26, 2011 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}"); Link to comment https://forums.phpfreaks.com/topic/225685-anthing-wrong-with-this-query/#findComment-1165318 Share on other sites More sharing options...
tastro Posted January 26, 2011 Share Posted January 26, 2011 you are connecting all this 3 together... i think that you will get an error here... you can't group/connect this together this way... but you can try it with the UNION mysql function. Link to comment https://forums.phpfreaks.com/topic/225685-anthing-wrong-with-this-query/#findComment-1165321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.