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)); Quote Link to comment 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? Quote Link to comment 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}"); Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.