Använd backtick(`) eller Single Quote(') för att ge kolumns aliasnamn i MySQL.
Prova detta:
SELECT `id` AS 'key', `country_name` AS value
FROM countries;
ELLER
SELECT `id` AS `key`, `country_name` AS value
FROM countries;
Använd backtick(`) eller Single Quote(') för att ge kolumns aliasnamn i MySQL.
Prova detta:
SELECT `id` AS 'key', `country_name` AS value
FROM countries;
ELLER
SELECT `id` AS `key`, `country_name` AS value
FROM countries;