I have 3 tables linked with a left join. see example below:
SELECT s.suiteid, s.testid, s.naam, ms.id, ms.projectid, ms.naam FROM suites as s
left join tests as t on s.testid = t.id
left join meta_suites as ms on t.projectid = ms.projectid
where s.testid = 44
So, if you ignore the second join, you get this:
10000, 44, 000_10000_suite_algemeen
Then, because of the test ID, with the third join this winds up getting duplicated, so you get the results you get, where it joins the test ID to the other.
Changing the second table to be a RIGHT JOIN should do the trick, though you'll likely get more rows then you want. If you add something like "GROUP BY ms.id', you can get rid of the duplicate ms.id rows (assuming ms.id is unique... if it's not you may lose results you want).
It seems that you want everything from meta_suites, so it may be prudent to rewrite your query and make that be the main table (in the from), and then do a cross join to get the other tables.
(SELECT s.id, s.suiteid, s.testid, s.naam, s.result, s.totalTime, s.numTestTotal, s.numTestPasses, s.numTestFailures FROM suites as s left join tests as t on s.testid = t.id where t.projectid=1 and s.testid =44)
union
(SELECT null,id,null, ms.naam,ms.omschrijving,null,null,null,null FROM meta_suites as ms where ms.projectid=1 and ms.id not in (select suiteid from suites))
With the union i combine the two tables with the folowing result:
Bookmarks