Joins are most certainly permitted, as far as I know, that can’t be stopped unless you don’t have rights on the underlying table.
When you setup your mysql db on dreamhost, you would have specified a host name for it to live on.
If so, in your browser, visit it’s phpMyAdmin interface by putting the host name into your browsers location bar:
When it asks for your username/password, put in your database username and password you use in your script.
Then go to the ‘SQL’ tab for your database and you can type your query in there to test it before putting it back in your php program
Of course, use the database query your php generates, not the php code version
That will allow you to experiment with your outcomes until you get results back, then you can put it in your program once you know its working.