generate SQL-queries in the PHP-code for checking rules per interface.