2 MYSL queries at the same time - causing a problem?
#3

Yes there is a problem, that's why you should use LEFT JOIN here:
Quote:

SELECT gh.*, acc.Username AS ownername FROM Houses gh LEFT JOIN Accounts acc ON gh.OwnerID = acc.ID

Don't know if your field which holds owner's ID in Houses table is named OwnerID, but I suppose so. This query will select owner's name (if ownerID is connected to any account ID), otherwise "virtual" field ownername will be NULL.
Reply


Messages In This Thread
2 MYSL queries at the same time - causing a problem? - by _Tommy - 15.02.2011, 16:47
Re: 2 MYSL queries at the same time - causing a problem? - by _Tommy - 15.02.2011, 21:02
Re: 2 MYSL queries at the same time - causing a problem? - by Sergei - 15.02.2011, 21:12
Re: 2 MYSL queries at the same time - causing a problem? - by _Tommy - 15.02.2011, 21:21
Re: 2 MYSL queries at the same time - causing a problem? - by Calgon - 16.02.2011, 14:20
Re: 2 MYSL queries at the same time - causing a problem? - by Sergei - 16.02.2011, 16:27

Forum Jump:


Users browsing this thread: 1 Guest(s)