If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

So what I need is to get the information (I was trying INNER JOIN but it doesn't like me) starting with the "plat" (community)

and then the name of the builder for that plat (plat.builder_id to company.company_title if company.company_type is 'builder')

and then the logo for the plat (via the "graphic" table using the "img_rep" table's assignment, i.e. img_rep.assoc_table = plat and img_rep.assoc_id = plat.id and img_rep.photo will be the graphic.id for several images -- the photo I need will have graphic.img_type = 'logo'

and then the "main photo" for the image, which will be the same as the logo except graphic.img_type = 'photo' and then it will need to have the lowest value of graphic.img_sequence value of the possible options

I don't know if I should just do this with several queries or if there's a way to just grab what I need in one fell swoop... I'm trying to practice writing more efficient code; I used to just do each table in its own query, so I've been using MySQL a long time, but I haven't been doing it all that well, haha.

Any advice or suggestions would be greatly appreciated; thanks in advance!

It's not apparent to me what field relates one table to another. You cannot join two tables unless there is some common field (or fields) they share that can be used in the ON clause of a JOIN. For instance, how do you know which address record belongs with which company record? Same for which graphic goes with which company, and so forth.