renfley Posted July 14, 2011 Share Posted July 14, 2011 So here is the deal i am querying one table withing the database and displaying them within another view. if( strtolower( $language->_lang ) == "fr-fr" ) $query = "Select id,idea_1 as title, challenge_id as challenge, is_anonymous from " . $db->nameQuote('#__table1_ideas') . " where userid = '" . $user->id . "' and is_draft = '0'"; else Prob is i also need challenge title from another table If anyone can help me out that would be great Thanks in advance Link to comment https://forums.phpfreaks.com/topic/242011-multiple-table-queries-please-help/ Share on other sites More sharing options...
Maq Posted July 14, 2011 Share Posted July 14, 2011 You need to join the other table. What's the actual problem? Link to comment https://forums.phpfreaks.com/topic/242011-multiple-table-queries-please-help/#findComment-1242826 Share on other sites More sharing options...
renfley Posted July 14, 2011 Author Share Posted July 14, 2011 I havnt a clue how LOL i know it is a very Very Simple solution but i just cant figure it out for the life of me LOL Link to comment https://forums.phpfreaks.com/topic/242011-multiple-table-queries-please-help/#findComment-1242827 Share on other sites More sharing options...
Maq Posted July 14, 2011 Share Posted July 14, 2011 Post your table definitions, what you want to extract & join on. We can help you with your syntax & logic. Have a look at this first - http://dev.mysql.com/doc/refman/5.0/en/join.html Link to comment https://forums.phpfreaks.com/topic/242011-multiple-table-queries-please-help/#findComment-1242828 Share on other sites More sharing options...
renfley Posted July 14, 2011 Author Share Posted July 14, 2011 if( strtolower( $language->_lang ) == "fr-fr" ) $query = "Select id,idea_1 as title, challenge_id as challenge, is_anonymous from " . $db->nameQuote('#__table1_ideas') . " where userid = '" . $user->id . "' and is_draft = '0'"; else i want to extract from table2 the challenge_title based on the challenge_id pull from table one if that makes sense Again thanks man Link to comment https://forums.phpfreaks.com/topic/242011-multiple-table-queries-please-help/#findComment-1242830 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.