Fixing Column values in MySQL table

I have a subtitle database website where users can upload a subtitle file to a subtitle database! In order not to duplicate a friend made me another table where 2 Code abbreviations at the end of the file name will be added when saving each subtitle for each specific subtitle in a specific language but I have problem

Everything is fine and works fine for languages ​​where only one language name is written in the table but where two or three language names are written in the table, it does not work at all, whether the language names are not written in the table as it should or what could be the problem ? Here is the table SQL file (for example the languages that doesnt work : ('Gaelic; Scottish Gaelic', 'gd') or ('Spanish; Castilian', 'es') etc..:

-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 08, 2019 at 11:22 PM
-- Server version: 10.1.43-MariaDB-cll-lve
-- PHP Version: 7.2.7

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `xxxx_xxx`
--

-- --------------------------------------------------------

--
-- Table structure for table `xxxx_xxxx`
--

CREATE TABLE `xxxxx_xxxxx` (
  `language` varchar(44) NOT NULL,
  `code` varchar(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `xxxx_xxxx`
--

INSERT INTO `language_code` (`language`, `code`) VALUES
('Abkhazian', 'ab'),
('Afar', 'aa'),
('Afrikaans', 'af'),
('Albanian', 'sq'),
('Amharic', 'am'),
('Arabic', 'ar'),
('Aragonese', 'an'),
('Armenian', 'hy'),
('Assamese', 'as'),
('Avestan', 'ae'),
('Aymara', 'ay'),
('Azerbaijani', 'az'),
('Bashkir', 'ba'),
('Basque', 'eu'),
('Belarusian', 'be'),
('Bengali', 'bn'),
('Bihari', 'bh'),
('Bislama', 'bi'),
('Bosnian', 'bs'),
('Breton', 'br'),
('Bulgarian', 'bg'),
('Burmese', 'my'),
('Catalan', 'ca'),
('Chamorro', 'ch'),
('Chechen', 'ce'),
('Chinese', 'zh'),
('Church Slavic; Slavonic; Old Bulgarian', 'cu'),
('Chuvash', 'cv'),
('Cornish', 'kw'),
('Corsican', 'co'),
('Croatian', 'hr'),
('Czech', 'cs'),
('Danish', 'da'),
('Divehi; Dhivehi; Maldivian', 'dv'),
('Dutch', 'nl'),
('Dzongkha', 'dz'),
('English', 'en'),
('Esperanto', 'eo'),
('Estonian', 'et'),
('Faroese', 'fo'),
('Fijian', 'fj'),
('Finnish', 'fi'),
('French', 'fr'),
('Gaelic; Scottish Gaelic', 'gd'),
('Galician', 'gl'),
('Georgian', 'ka'),
('German', 'de'),
('Greek, Modern (1453-)', 'el'),
('Guarani', 'gn'),
('Gujarati', 'gu'),
('Haitian; Haitian Creole', 'ht'),
('Hausa', 'ha'),
('Hebrew', 'he'),
('Herero', 'hz'),
('Hindi', 'hi'),
('Hiri Motu', 'ho'),
('Hungarian', 'hu'),
('Icelandic', 'is'),
('Ido', 'io'),
('Indonesian', 'id'),
('Interlingua (International Auxiliary Languag', 'ia'),
('Interlingue', 'ie'),
('Inuktitut', 'iu'),
('Inupiaq', 'ik'),
('Irish', 'ga'),
('Italian', 'it'),
('Japanese', 'ja'),
('Javanese', 'jv'),
('Kalaallisut', 'kl'),
('Kannada', 'kn'),
('Kashmiri', 'ks'),
('Kazakh', 'kk'),
('Khmer', 'km'),
('Kikuyu; Gikuyu', 'ki'),
('Kinyarwanda', 'rw'),
('Kirghiz', 'ky'),
('Komi', 'kv'),
('Korean', 'ko'),
('Kuanyama; Kwanyama', 'kj'),
('Kurdish', 'ku'),
('Lao', 'lo'),
('Latin', 'la'),
('Latvian', 'lv'),
('Limburgan; Limburger; Limburgish', 'li'),
('Lingala', 'ln'),
('Lithuanian', 'lt'),
('Luxembourgish; Letzeburgesch', 'lb'),
('Macedonian', 'mk'),
('Malagasy', 'mg'),
('Malay', 'ms'),
('Malayalam', 'ml'),
('Maltese', 'mt'),
('Manx', 'gv'),
('Maori', 'mi'),
('Marathi', 'mr'),
('Marshallese', 'mh'),
('Moldavian', 'mo'),
('Mongolian', 'mn'),
('Nauru', 'na'),
('Navaho, Navajo', 'nv'),
('Ndebele, North', 'nd'),
('Ndebele, South', 'nr'),
('Ndonga', 'ng'),
('Nepali', 'ne'),
('Northern Sami', 'se'),
('Norwegian', 'no'),
('Norwegian Bokmal', 'nb'),
('Norwegian Nynorsk', 'nn'),
('Nyanja; Chichewa; Chewa', 'ny'),
('Occitan (post 1500); Provencal', 'oc'),
('Oriya', 'or'),
('Oromo', 'om'),
('Ossetian; Ossetic', 'os'),
('Pali', 'pi'),
('Panjabi', 'pa'),
('Persian', 'fa'),
('Polish', 'pl'),
('Portuguese', 'pt'),
('Pushto', 'ps'),
('Quechua', 'qu'),
('Raeto-Romance', 'rm'),
('Romanian', 'ro'),
('Rundi', 'rn'),
('Russian', 'ru'),
('Samoan', 'sm'),
('Sango', 'sg'),
('Sanskrit', 'sa'),
('Sardinian', 'sc'),
('Serbian', 'sr'),
('Shona', 'sn'),
('Sichuan Yi', 'ii'),
('Sindhi', 'sd'),
('Sinhala; Sinhalese', 'si'),
('Slovak', 'sk'),
('Slovenian', 'sl'),
('Somali', 'so'),
('Sotho, Southern', 'st'),
('Spanish; Castilian', 'es'),
('Sundanese', 'su'),
('Swahili', 'sw'),
('Swati', 'ss'),
('Swedish', 'sv'),
('Tagalog', 'tl'),
('Tahitian', 'ty'),
('Tajik', 'tg'),
('Tamil', 'ta'),
('Tatar', 'tt'),
('Telugu', 'te'),
('Thai', 'th'),
('Tibetan', 'bo'),
('Tigrinya', 'ti'),
('Tonga (Tonga Islands)', 'to'),
('Tsonga', 'ts'),
('Tswana', 'tn'),
('Turkish', 'tr'),
('Turkmen', 'tk'),
('Twi', 'tw'),
('Uighur', 'ug'),
('Ukrainian', 'uk'),
('Urdu', 'ur'),
('Uzbek', 'uz'),
('Vietnamese', 'vi'),
('Volapuk', 'vo'),
('Walloon', 'wa'),
('Welsh', 'cy'),
('Western Frisian', 'fy'),
('Wolof', 'wo'),
('Xhosa', 'xh'),
('Yiddish', 'yi'),
('Yoruba', 'yo'),
('Zhuang; Chuang', 'za'),
('Zulu', 'zu');
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

1 answer

  • answered 2019-12-09 13:45 asimshahiddIT

    You can try the following

      SET DEF OFF;
      INSERT INTO `language_code` (`language`, `code`) VALUES
      Values('Gaelic\; Scottish Gaelic', 'gd');