Hey Guys,
I'm building (what I thought to be) a simple php + mysql billing system for some websites I host. I just wanted an easy way to track whether I'd received payment from a customer on a particular month. I have created a database with the attached schema (I wanted to paste here but it didn't seem to preserve the formatting - have attached a gif). I've got the basics of mysql queries down but have failed to understand what I believe to be relatively complex left joins. I understand the concept, and can do left joins on a situation with only 2 tables..I'm dealing with 4. Maybe the schema is wrong, in which I'd be keen to hear your guys opinions on any improvements.
What I wish to have is the bottom query but with 'paid' and 'reminder' as selected fields as well. As this payment_tracking table will only have an entry for a website if I received payment or I have sent a reminder, it needs to be left joined so it still shows all websites, regardless of whether this paid or reminder entry exists. I'm wanting the final to look like the second attachment.
Is there an easy way to do this? Is it even possible?
Any help would be great,
Cheers