I have the following query to create a multi level drop down menu for events (region, county, city):
SELECT
P.province_eng
, CO.county_eng
, C.city_eng
FROM events E
LEFT
JOIN provinces P
ON E.province_id = P.province_id
LEFT
JOIN counties CO
ON E.county_id = CO.county_id
LEFT
JOIN cities C
ON E.city_id = C.city_id
GROUP BY
province_eng
, county_eng
, city_eng
ORDER BY
province_eng
, county_eng
, city_eng
But I get an empty string for city_eng? This is one of my test inserts in the table events:
INSERT INTO `events`
(`event_id`, `province_id`, `county_id`, `city_id`, `event_name_eng`, `event_name_gr`, `event_venue_eng`, `event_venue_gr`, `event_date`, `end_date`, `event_text_eng`, `event_text_gr`, `event_telephone`, `event_email`, `isPending`)
VALUES
(13, 1, 3, 13, 'Test Name', NULL, 'Test Venu', NULL, '2011-01-03', NULL, 'Test', NULL, '26756 6543', 'yourmail@yourmail.com', 1);
As you can see there is a city_id present in the inser, but somehow It keeps giving me a empty string.