In the service table would be a service that a user has added, and the country is where the service is available.
So for example, User 1 could say offer Dog Trainer in UK (row 1), Baby Sitter in US (row 2), Plumber in NZ (Row 3).
At the moment it is pulling all the services, and saying they are all in NZ. As I have the ID field sorted descending order (in $editServices). So from what I can gather it's completely ignoring while($viewCountry = $db->fetch_array($getCountries)) as a loop.
Because, I think it should be running
PHP Code:
$getChecked = $db->query_first("SELECT id, country FROM " . TABLE_PREFIX . "services WHERE country = " . $viewCountry['id'] . " AND id = " . $editService['id']);
each time it pulls a country. It is pulling all the countries in the database. I know it isn't great if there's a lot of countries, as it should be running for each country that it pulls, if someone knows a better way, I'd love to hear it.