Fix collation error by using BINARY in LIKE operations

Added BINARY keyword to LIKE clauses in Search() function to bypass
collation issues. BINARY forces byte-by-byte comparison and avoids
'Illegal mix of collations' error when connection uses utf8mb4
and table uses latin1_swedish_ci.
This commit is contained in:
2026-01-07 23:17:50 -06:00
parent a0ada73c81
commit 4dbc9cfc52

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 BINARY "%'.$this->descripcion.'%"';
if($this->codigoBarra)
$sqlAdd .= ' AND p.codigoBarra LIKE "%'.$this->codigoBarra.'%"';
$sqlAdd .= ' AND p.codigoBarra LIKE BINARY "%'.$this->codigoBarra.'%"';
if($sqlAdd != ''){