Fix collation mismatch error in productos search

Added COLLATE latin1_swedish_ci to LIKE operations in Search()
function to prevent 'Illegal mix of collations' error when searching
by modelo or codigoBarra. The database uses latin1_swedish_ci but
PHP 8 uses UTF-8 encoding.
This commit is contained in:
2026-01-07 23:06:54 -06:00
parent c616072d6c
commit d28414cff1

View File

@@ -686,10 +686,10 @@ class Producto extends Main
$sqlAdd .= ' AND p.prodCatId = "'.$this->prodCatId.'"';
if($this->descripcion)
$sqlAdd .= ' AND p.modelo LIKE "%'.$this->descripcion.'%"';
$sqlAdd .= ' AND p.modelo LIKE "%'.$this->descripcion.'%" COLLATE latin1_swedish_ci';
if($this->codigoBarra)
$sqlAdd .= ' AND p.codigoBarra LIKE "%'.$this->codigoBarra.'%"';
$sqlAdd .= ' AND p.codigoBarra LIKE "%'.$this->codigoBarra.'%" COLLATE latin1_swedish_ci';
if($sqlAdd != ''){