Jump to content

trouble joining 2 databases


boba fett

Recommended Posts

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

$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.

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.