Compare 2 tables: color green if exist, else color red

flyboeing 20 Nov, 2012
Hello all,

I have 2 tables in my database. One is with all the Airlines, the other one is the existing content table.
For myself I want to make an overview of which airline I have added to my website. I can make a list of all the airlines from my Airlines table. The next step would be to check if the Airlines name exists in the content table (title column). If it exist it turns green (for example), if the Airline does not exist in the content table, colors red.

So I have to compare two tables, but how do I do this?

I hope someone can help me with this🙂

Kind regards,
Ruud
GreyHead 21 Nov, 2012
Hi Ruud,

You can do this with a MySQL query in a Code action. See this StackOverflow answer for some suggestions.

Bob

PS I'd probably use PHPMyAdmin, MySQL WorkBench or the Joomla! AceSQL extension for this kind of query.
Max_admin 21 Nov, 2012
Hi,

The way to do this in Connectivity is as following:

#1- your airlines table set as the main table and has model ID "Airline".
#2- the content table under the multi tables and has model id "Article" and the join rule setup correctly.
#3- in your custom listing code, check
empty($row['Article']['title'])
😉

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.