boba fett Posted July 21, 2010 Share Posted July 21, 2010 I'm trying to join 2 databases for my webpage. I'm using this bit of code to do it SELECT * FROM eachsnake JOIN specieslist ON eachsnake.Scientific_Name = specieslist.Scientific_Name but when i try to get a response only 1 of the 700 entries comes up Is this code right? or am i missing something? Link to comment https://forums.phpfreaks.com/topic/208418-trouble-joining-2-databases/ Share on other sites More sharing options...
inversesoft123 Posted July 21, 2010 Share Posted July 21, 2010 $sql = "SELECT a.id, a.file, a.task, b.id, b.file, b.task FROM pf_table a INNER JOIN pf_table1 b ON (a.id = b.id) OR (a.fie = b.file) WHERE (b.file='".$file."' OR b.id='".$id."') GROUP BY 1,2 ORDER BY $something DESC"; I have explained general joining and grouping idea here, as I don't understand what exactly your are doing in your query. Link to comment https://forums.phpfreaks.com/topic/208418-trouble-joining-2-databases/#findComment-1089135 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.