public function getTaxonbyName($taxonName)
 {
     global $db;
     $query = "SELECT * FROM species WHERE Scientific_Name = '" . str_replace("_", " ", $taxonName) . "' AND Main_Crop = 0";
     $result = $db->getRow($query);
     if (!empty($result)) {
         // Create taxon object.
         $taxon = new Taxon($result["Valid_Taxon_ID"]);
         if ($result["Valid_Taxon_ID"] != $result["Taxon_ID"]) {
             // Get the valid scientific name just in case if is a synonim
             $query = "SELECT * FROM species WHERE Valid_Taxon_ID = " . $result["Valid_Taxon_ID"] . " AND Taxon_ID = Valid_Taxon_ID";
             $result_valid_taxon = $db->getRow($query);
             if (!empty($result_valid_taxon)) {
                 $valid_taxon = new Taxon($result_valid_taxon["Valid_Taxon_ID"]);
                 $valid_taxon->setFamily($result_valid_taxon["Family"]);
                 $valid_taxon->setFamilyAuthor($result_valid_taxon["FamilyAuthor"]);
                 $valid_taxon->setGenus(trim($result_valid_taxon["Genus"]));
                 $valid_taxon->setSpecie(trim($result_valid_taxon["Species"]));
                 $valid_taxon->setSpecieAuthor(trim($result_valid_taxon["Species_Author"]));
                 $valid_taxon->setSubspecie(trim($result_valid_taxon["Subsp"]));
                 $valid_taxon->setSubspecieAuthor($result_valid_taxon["Subsp_Author"]);
                 $valid_taxon->setVariety(trim($result_valid_taxon["Var"]));
                 $valid_taxon->setVarietyAuthor(trim($result_valid_taxon["Var_Author"]));
                 $valid_taxon->setForm(trim($result_valid_taxon["Form"]));
                 $valid_taxon->setFormAuthor(trim($result_valid_taxon["Form_Author"]));
                 $valid_taxon->setMainCrop(trim($result_valid_taxon["Main_Crop"]));
                 // Asignando el nombre valido en base a la informacion del taxon verdadero
                 $taxon->setValidName(trim($valid_taxon->generateScientificName(true, false)));
             }
         }
         $taxon->setFamily($result["Family"]);
         $taxon->setFamilyAuthor($result["FamilyAuthor"]);
         $taxon->setGenus(trim($result["Genus"]));
         $taxon->setSpecie(trim($result["Species"]));
         $taxon->setSpecieAuthor(trim($result["Species_Author"]));
         $taxon->setSubspecie(trim($result["Subsp"]));
         $taxon->setSubspecieAuthor($result["Subsp_Author"]);
         $taxon->setVariety(trim($result["Var"]));
         $taxon->setVarietyAuthor(trim($result["Var_Author"]));
         $taxon->setForm(trim($result["Form"]));
         $taxon->setFormAuthor(trim($result["Form_Author"]));
         $taxon->setMainCrop(trim($result["Main_Crop"]));
         $taxon->setCommonName(trim($result["Common_Name"]));
         return $taxon;
     }
     return null;
 }