making a join on a a diffrent DB

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

making a join on a a diffrent DB

Post by pelegk2 »

i have 2 db
when i make a simple query like :
SELECT * from order_header. common.clients where common.clients.client_id=order_header.client_id and order_header.del_id=9876
but when i want to do a JOIN :
SELECT * from order_header
LEFT JOIN common.clients On common.clients.client_id=order_header.LAKOACH
where order_header.del_id=9876
it dosent let me ! why?
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

this may be of some good help to you :
http://dev.mysql.com/doc/mysql/en/left- ... ation.html

anyways, try this :

Code: Select all

SELECT * from order_header 
LEFT JOIN common.clients On (common.clients.client_id=order_header.LAKOACH) 
where order_header.del_id=9876
Post Reply