From d28414cff11363706913d3d2b26d495d6ec749d3 Mon Sep 17 00:00:00 2001 From: nickpons666 Date: Wed, 7 Jan 2026 23:06:54 -0600 Subject: [PATCH] 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. --- classes/producto.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/producto.class.php b/classes/producto.class.php index aef78e8..f6f86b6 100755 --- a/classes/producto.class.php +++ b/classes/producto.class.php @@ -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 != ''){