无法在每个领域获得特定语言

I try to create my form to add category in 3 languages: "fr", "en", "es".

When I work with 2 languages everything is good, but when I put a third language "es", it doesn’t work.

This is my request

<?php
$catid=  $_GET["cat"];
$Command = "SELECT t.cat,t.cat_id, fr.cat as cat_fr,es.cat as cat_es
FROM category t 
INNER JOIN categoty_translation fr on t.cat_id = fr.catId
INNER JOIN category_translation es on t.cat_id =es.catId
INNER JOIN language l ON fr.langcode = l.code and es.langcode = l.code
WHERE t.cat_id='$catid'"; 
$cat = $row["cat"];
$cat_fr = $row["cat_fr"];
$cat_es= $row["cat_es"];
?>

In the form, I get the Spanish word two times This the form:

<div class="form-group">
<label for="cat en" class="control-label">English Category </label>
<input type="text" name="cat" id="cat" value="<?=$cat?>" class="form-control">
</div>
<div class="form-group">
<label for="cat fr" class="control-label">French Category </label>
<input type="text" name="cat_fr" value="<?=$cat_fr?>" class="form-control">
</div>
<div class="form-group">
<label for="cat es" class="control-label">Spanish Category</label>
<input type="text" name="cat_es" value="<?=$cat_es?>" class="form-control">
</div>

In my database. i have 2 tables: "category" that content default language (en) and category translation that content tree language "en", "fr" and "es".

Like I said if I use 2 languages everything is okay, but when I add the third language I got only the default language and only the last language "es" in the file input fr and es.

</div>