Custom SQL Query
I need help with an SQL query if you can.
So in our admin system I have an html table that shows a list of accounts from a database table ( Accounts Table ) . I’ve removed name, email and other columns that aren’t necessary for this.
Each of these accounts has a members list that is stored in another table ( Members table ). These tables have a relational value which is the Account_id primary key in the Accounts table and the Account_ID foreign key in the members table.
The members table has a ‘Fee’ column which can have a value of Paid or Unpaid.
So this is what I want to do…
When ALL values of the Fee column for a related account has a value of paid, I want to highlight the row, in the html table showing the accounts list, in a different colour.
An example using the sample tables would be account_id 3
I’m assuming I need to use COUNT in the query. I’m just not sure how to build this and then reference it to highlight each row In the html table.
I hope this makes sense.
Thanks in advance.